Table
Plain table markup (thead, tbody,
th, td) styled directly. No classes; the header row and
row hover come for free.
A data table
When a table is wider than its column, wrap it in a scroll area so it scrolls sideways on its own instead of pushing the page wider.
| ID | Login | Group | Added | |
|---|---|---|---|---|
| 1 | admin | admin@example.com | Superuser | 2024-01-15 |
| 2 | ada | ada@example.com | Editors | 2024-02-20 |
| 3 | linus | linus@example.com | Editors | 2024-03-02 |
| 4 | grace | grace@example.com | Viewers | 2024-03-19 |
<div role="region" aria-label="Users" tabindex="0">
<table>
<thead><tr><th>ID</th><th>Login</th><th>Email</th><th>Group</th><th>Added</th></tr></thead>
<tbody>
<tr><td>1</td><td>admin</td><td>admin@example.com</td><td>Superuser</td><td>2024-01-15</td></tr>
<tr><td>2</td><td>ada</td><td>ada@example.com</td><td>Editors</td><td>2024-02-20</td></tr>
…
</tbody>
</table>
</div>
With actions
Cells hold any inline content: a chip for the status, and small buttons in a
buttons row for the actions.
| Login | Group | Status | Actions |
|---|---|---|---|
| admin | Superuser | active | |
| ada | Editors | active | |
| linus | Editors | invited |
<div role="region" aria-label="Users with actions" tabindex="0">
<table>
<thead><tr><th>Login</th><th>Group</th><th>Status</th><th>Actions</th></tr></thead>
<tbody>
<tr>
<td>admin</td>
<td>Superuser</td>
<td><span class="chip teal">active</span></td>
<td>
<div class="buttons">
<a class="button small" href="users/admin/">Edit</a>
<button class="ghost small">Delete</button>
</div>
</td>
</tr>
…
</tbody>
</table>
</div>