Professional Table Heatmap - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Professional Table Heatmap</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> <style> body { font-family: 'Arial', sans-serif; background-color: #f0f2f5; margin: 0; padding: 20px; display: flex; justify-content: center; align-items: center; height: 100vh; } .heatmap-table { border-collapse: collapse; overflow: hidden; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); } .heatmap-table th, .heatmap-table td { padding: 15px; text-align: center; position: relative; transition: background-color 0.3s ease; } .heatmap-table th { background-color: #4CAF50; color: white; font-size: 1.1em; } .heatmap-table td { cursor: pointer; } .heatmap-table td::before { content: attr(data-value); position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 0.8em; opacity: 0; transition: opacity 0.3s ease; } .heatmap-table td:hover::before { opacity: 1; } .heatmap-table td[data-value="low"] { background-color: #f4cccc; } .heatmap-table td[data-value="medium"] { background-color: #f6b26b; } .heatmap-table td[data-value="high"] { background-color: #93c47d; } .heatmap-table td[data-value="very-high"] { background-color: #6aa84f; } .heatmap-table td[data-value="low"]:hover, .heatmap-table td[data-value="medium"]:hover, .heatmap-table td[data-value="high"]:hover, .heatmap-table td[data-value="very-high"]:hover { background-color: #ffeb3b; color: #000; } .emoji { font-size: 1.5em; display: inline-block; transition: transform 0.3s ease; } .heatmap-table td:hover .emoji { transform: scale(1.2); } .info-icon { margin-left: 5px; color: #4CAF50; cursor: pointer; transition: transform 0.3s ease; } .info-icon:hover { transform: rotate(360deg); } </style> </head> <body> <table class="heatmap-table"> <thead> <tr> <th>Category <i class="fas fa-info-circle info-icon" title="Information about categories"></i></th> <th>Item 1</th> <th>Item 2</th> <th>Item 3</th> <th>Item 4</th> </tr> </thead> <tbody> <tr> <td>Category 1</td> <td data-value="low"><span class="emoji">😟</span></td> <td data-value="medium"><span class="emoji">😐</span></td> <td data-value="high"><span class="emoji">😊</span></td> <td data-value="very-high"><span class="emoji">😁</span></td> </tr> <tr> <td>Category 2</td> <td data-value="high"><span class="emoji">😊</span></td> <td data-value="very-high"><span class="emoji">😁</span></td> <td data-value="low"><span class="emoji">😟</span></td> <td data-value="medium"><span class="emoji">😐</span></td> </tr> <tr> <td>Category 3</td> <td data-value="medium"><span class="emoji">😐</span></td> <td data-value="low"><span class="emoji">😟</span></td> <td data-value="very-high"><span class="emoji">😁</span></td> <td data-value="high"><span class="emoji">😊</span></td> </tr> </tbody> </table> <script> document.querySelectorAll('.heatmap-table td').forEach(cell => { cell.addEventListener('click', () => { const value = cell.getAttribute('data-value'); alert(`You clicked on a cell with value: ${value}`); }); }); </script> </body> </html>