Nature Table - 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>Nature Table - Eco-Friendly Data Table Design</title> <style> body { font-family: 'Times New Roman', serif; background: #e8f5e9; color: #2e7d32; margin: 0; padding: 20px; display: flex; justify-content: center; align-items: center; height: 100vh; } table { border-collapse: collapse; width: 90%; margin: 20px 0; font-size: 18px; box-shadow: 0 2px 10px rgba(46,125,50,.3); background-color: #ffffff; animation: popIn 1s ease-in-out; } table thead tr { background-color: #66bb6a; color: #ffffff; text-align: left; font-weight: bold; animation: slideInRight 1s ease-in-out; } table th, table td { padding: 12px 15px; border: 1px solid #c8e6c9; } table tbody tr { border-bottom: 1px solid #c8e6c9; transition: background-color 0.3s ease; } table tbody tr:hover { background-color: #a5d6a7; cursor: pointer; } table tbody tr:last-of-type { border-bottom: 2px solid #66bb6a; } @keyframes popIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } } @keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } } </style> </head> <body> <table> <thead> <tr> <th>ID</th> <th>Name</th> <th>Email</th> <th>Website</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>John Doe</td> <td>john@example.com</td> <td>www.johndoe.com</td> </tr> <tr> <td>2</td> <td>Jane Smith</td> <td>jane@example.com</td> <td>www.janesmith.com</td> </tr> <tr> <td>3</td> <td>Sam Wilson</td> <td>sam@example.com</td> <td>www.samwilson.com</td> </tr> </tbody> </table> <script> document.addEventListener('DOMContentLoaded', function() { const rows = document.querySelectorAll('tbody tr'); rows.forEach(row => { row.addEventListener('click', () => { rows.forEach(r => r.style.backgroundColor = ''); row.style.backgroundColor = '#dcedc8'; }); }); }); </script> </body> </html>