Royal 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>Royal Table - Luxurious Data Table Design</title> <style> body { font-family: 'Garamond', serif; background: #f3e5f5; color: #4a148c; 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(74,20,140,.2); background-color: #ffffff; animation: fadeIn 1s ease-in-out; } table thead tr { background-color: #8e24aa; color: #ffffff; text-align: left; font-weight: bold; animation: fadeInUp 1s ease-in-out; } table th, table td { padding: 12px 15px; border: 1px solid #f3e5f5; } table tbody tr { border-bottom: 1px solid #f3e5f5; transition: background-color 0.3s ease; } table tbody tr:hover { background-color: #e1bee7; cursor: pointer; } table tbody tr:last-of-type { border-bottom: 2px solid #8e24aa; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes fadeInUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } } </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 = '#ce93d8'; }); }); }); </script> </body> </html>