Tables use a composable architecture with a base class and optional modifiers. The base style is minimalistic — clean borders, no background fills — and modifiers layer on additional behaviour.
Structure
Every table needs two elements:
- A scroll wrapper () for horizontal overflow on small screens
- The table element with the base class
| Name | Type | Status |
|---|---|---|
| Alpha | Primary | Active |
| Beta | Secondary | Pending |
| Gamma | Tertiary | Inactive |
<div class="table-scroll">
<table class="table">
<thead>
<tr>
<th>Column</th>
<th>Column</th>
</tr>
</thead>
<tbody>
<tr>
<td>Data</td>
<td>Data</td>
</tr>
</tbody>
</table>
</div>
Base Class
The class provides the default minimalistic style:
| Property | Value |
|---|---|
| Border collapse | collapse |
| Width | fit-content (max 100%) |
| Font size | |
| Font variant | tabular-nums |
| Header background | Transparent |
| Header border | var(--border-s) solid var(--border-secondary) |
| Body row border | var(--border-s) solid var(--border-faded) |
| Cell padding | var(--space-m) var(--space-l) |
Modifiers
Modifiers are added alongside on the <table> element. They can be combined freely.
| Class | Effect |
|---|---|
| Sets width to 100% | |
| Adds hover highlight on body rows | |
| Adds background colour to header cells |
Full Width
| Name | Role |
|---|---|
| Alice | Designer |
| Bob | Developer |
<table class="table table-full">
Hoverable Rows
| Name | Role |
|---|---|
| Alice | Designer |
| Bob | Developer |
| Carol | Manager |
<table class="table table-hover">
Filled Header
| Name | Role |
|---|---|
| Alice | Designer |
| Bob | Developer |
<table class="table table-header-filled">
Footer
The <tfoot> element is styled automatically when inside a :
- Top border:
var(--border-m) solid var(--border-primary) - Header cells: bold weight
- Data cells: semi-bold weight
| Item | Price |
|---|---|
| Widget | £50 |
| Gadget | £75 |
| Total | £125 |
<table class="table table-full">
<thead>
<tr><th>Item</th><th>Price</th></tr>
</thead>
<tbody>
<tr><td>Widget</td><td>£50</td></tr>
</tbody>
<tfoot>
<tr><th>Total</th><td>£50</td></tr>
</tfoot>
</table>
Combining Modifiers
Modifiers compose naturally. A full-featured table with hover, filled header, and footer:
| Item | Qty | Price |
|---|---|---|
| Widget | 2 | £100 |
| Gadget | 1 | £75 |
| Doohickey | 3 | £60 |
| Total | 6 | £235 |
<div class="table-scroll">
<table class="table table-full table-hover table-header-filled">
<thead>...</thead>
<tbody>...</tbody>
<tfoot>...</tfoot>
</table>
</div>
Responsive Behaviour
Tables are mobile-friendly by default:
- Horizontal scroll — allows swiping when the table is wider than the viewport
- Scroll hint — a subtle fade appears on the right edge when the table overflows, indicating more content. It disappears once the user scrolls to the end
- Condensed padding — at
768pxand below, cell padding and font size reduce automatically to fit more content on screen
No extra classes or markup are needed — this behaviour is built into and .
Markdown Tables
Tables generated from markdown (via the doc generator) automatically receive the class inside a wrapper. No manual class application is needed for documentation pages.
Do Not
- Do not apply spacing or margins to directly — use the scroll wrapper or parent block for spacing
- Do not create combined classes like — compose existing modifiers instead
- Do not hardcode border or colour values — use the design system tokens