diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 343ec3b..086f763 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -5371,18 +5371,16 @@ void handleRoot() { html += "h1 {text-align: center; color: #ffffff; margin-top: 20px; font-size: 32px;}"; html += "img {display: block; margin: 0 auto; max-width: 100%; height: auto; padding-top: 20px; cursor: pointer;}"; html += "table {width: 90%; margin: 0 auto; border-collapse: collapse; border-radius: 8px; overflow: hidden;}"; - html += "th {background-color: #333; color: white; padding: 12px; text-align: left; font-size: 18px;}"; + html += "th {background-color: #333; color: white; padding: 12px; text-align: left; font-size: 18px; cursor: pointer; position: relative;}"; html += "td {background-color: #2a2a2a; color: white; padding: 10px; text-align: left; font-size: 16px;}"; html += "tr:nth-child(even) {background-color: #252525;}"; - - // Full row background highlight - html += "tr:hover {background-color: #ff6600 !important;}"; // Solid orange highlight on hover - html += "tr:hover td {background-color: #ff6600 !important;}"; // Ensure cells have the same highlight - + html += "tr:hover {background-color: #ff6600 !important;}"; + html += "tr:hover td {background-color: #ff6600 !important;}"; html += "button {background-color: #ffcc00; color: black; border: none; padding: 12px 20px; font-size: 18px; cursor: pointer; border-radius: 5px; display: block; margin: 20px auto;}"; html += "button:hover {background-color: #ff9900;}"; html += "@media (max-width: 768px) { table {width: 100%;} th, td {font-size: 14px; padding: 8px;} }"; html += ".go-to-bottom {position: fixed; bottom: 30px; right: 30px; background-color: #ffcc00; color: black; border: none; padding: 12px 20px; font-size: 18px; cursor: pointer; border-radius: 5px; z-index: 100;}"; + html += ".sort-icon {font-size: 18px; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);}"; html += ""; html += ""; @@ -5396,27 +5394,70 @@ void handleRoot() { html += ""; html += ""; - // JavaScript for scrolling + // JavaScript for scrolling and sorting html += ""; - html += ""; + html += "
"; String header = ""; if (file.available()) { header = file.readStringUntil('\n'); html += ""; int startIndex = 0; + int columnIndex = 0; + // Generate table headers with sorting functionality while (startIndex < header.length()) { int endIndex = header.indexOf(',', startIndex); if (endIndex == -1) endIndex = header.length(); String column = header.substring(startIndex, endIndex); - html += ""; // Removed sorting symbols + // Add clickable headers for sorting + html += ""; // Sorting icon placeholder startIndex = endIndex + 1; + columnIndex++; } html += ""; }
" + column + "" + column; + html += "