Table
Tables are for data with real row and column relationships — never for layout. Pedantic tables name themselves with a caption and label every header cell.
Basic table
Live example — data table with status badges
| Project | Owner | Status | Due |
|---|---|---|---|
| Website Redesign | Design Team | On Track | Dec 4, 2026 |
| App Onboarding | Product Team | At Risk | Dec 11, 2026 |
| Billing Migration | Engineering | Blocked | Dec 18, 2026 |
| Help Center Refresh | Support Team | Planned | Jan 8, 2027 |
<div class="pds-table-wrap">
<table class="pds-table">
<caption>Open projects by status</caption>
<thead>
<tr><th scope="col">Project</th><th scope="col">Owner</th><th scope="col">Status</th><th scope="col">Due</th></tr>
</thead>
<tbody>
<tr><th scope="row">Website Redesign</th><td>Design Team</td>
<td><span class="pds-badge pds-badge--success">On Track</span></td><td>Dec 4, 2026</td></tr>
<tr><th scope="row">App Onboarding</th><td>Product Team</td>
<td><span class="pds-badge pds-badge--warning">At Risk</span></td><td>Dec 11, 2026</td></tr>
<tr><th scope="row">Billing Migration</th><td>Engineering</td>
<td><span class="pds-badge pds-badge--danger">Blocked</span></td><td>Dec 18, 2026</td></tr>
</tbody>
</table>
</div>Anatomy
- Caption — every table has one. It is the table’s name and its summary in a few words.
- Header row — navy band, white text, one header
per column with
scope="col". - Row headers — the identifying cell in each row
is a
<th scope="row">, so screen readers announce rows by name. - Striping — alternating cream rows are a visual aid only; meaning never depends on them.
- Badges — status is text inside a colored badge, never color alone.
Rules
Do
Wrap wide tables in .pds-table-wrap so they scroll
horizontally inside the page instead of breaking the layout.
Left-align text columns; keep numbers in their natural reading order.
Don’t
Don’t use tables for page layout, merge cells to fake a
design, or leave header cells as plain <td>.
Don’t put essential actions only in a hover state inside a row.
Accessibility notes
scopeon every header cell; complex tables with two header levels useid/headersinstead — and get a second review.- Sortable columns are buttons inside the header cell with
aria-sorton the<th>; sorting is never icon-only. - The caption is visible — it doubles as the table’s heading for every reader.