Sure! Here's a modern, responsive table design using HTML and Tailwind CSS. This includes styles for table headers, rows, hover effects, and responsive behavior.
✅ Example: Responsive Table in HTML & Tailwind
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tailwind Table</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-100 p-6 font-sans">
<div class="container mx-auto">
<div class="bg-white shadow-md rounded-lg overflow-x-auto">
<table class="min-w-full table-auto">
<thead>
<tr class="bg-gray-200 text-gray-600 uppercase text-sm leading-normal">
<th class="py-3 px-6 text-left">Name</th>
<th class="py-3 px-6 text-left">Email</th>
<th class="py-3 px-6 text-center">Role</th>
<th class="py-3 px-6 text-center">Status</th>
<th class="py-3 px-6 text-center">Actions</th>
</tr>
</thead>
<tbody class="text-gray-700 text-sm font-light">
<tr class="border-b border-gray-200 hover:bg-gray-100">
<td class="py-3 px-6 text-left whitespace-nowrap">John Doe</td>
<td class="py-3 px-6 text-left">john@example.com</td>
<td class="py-3 px-6 text-center">Admin</td>
<td class="py-3 px-6 text-center">
<span class="bg-green-200 text-green-800 py-1 px-3 rounded-full text-xs">Active</span>
</td>
<td class="py-3 px-6 text-center">
<button class="bg-blue-500 text-white px-3 py-1 rounded hover:bg-blue-600 text-sm">Edit</button>
<button class="bg-red-500 text-white px-3 py-1 rounded hover:bg-red-600 text-sm ml-2">Delete</button>
</td>
</tr>
<tr class="border-b border-gray-200 hover:bg-gray-100">
<td class="py-3 px-6 text-left">Jane Smith</td>
<td class="py-3 px-6 text-left">jane@example.com</td>
<td class="py-3 px-6 text-center">Editor</td>
<td class="py-3 px-6 text-center">
<span class="bg-yellow-200 text-yellow-800 py-1 px-3 rounded-full text-xs">Pending</span>
</td>
<td class="py-3 px-6 text-center">
<button class="bg-blue-500 text-white px-3 py-1 rounded hover:bg-blue-600 text-sm">Edit</button>
<button class="bg-red-500 text-white px-3 py-1 rounded hover:bg-red-600 text-sm ml-2">Delete</button>
</td>
</tr>
<!-- Add more rows here -->
</tbody>
</table>
</div>
</div>
</body>
</html>
✨ Features:
- Responsive layout (scrolls on small screens)
- Clean and modern styling
- Hover effects for better UX
- Rounded buttons for actions
- Soft colors for status tags
🛠️ Notes:
- No JavaScript required for basic table behavior
- You can customize this to include pagination, sorting, or use with frameworks like React or Vue
Would you like a version with search functionality, sorting, or linked to a backend like Laravel or Django? Just let me know!