Loading…
‹ Pedantic

Component · Finished build

Table

Library nameTable Component
Conforming nameNot assigned yet — the name does not decompose into parent + child.
StatusFinished
BuildFinished Web build — framework-free HTML/CSS, documented with its working example and the exact code behind it.

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

Open projects by status
ProjectOwnerStatusDue
Website RedesignDesign TeamOn TrackDec 4, 2026
App OnboardingProduct TeamAt RiskDec 11, 2026
Billing MigrationEngineeringBlockedDec 18, 2026
Help Center RefreshSupport TeamPlannedJan 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

  • scope on every header cell; complex tables with two header levels use id/headers instead — and get a second review.
  • Sortable columns are buttons inside the header cell with aria-sort on the <th>; sorting is never icon-only.
  • The caption is visible — it doubles as the table’s heading for every reader.