Skip to content

Table

Interactive specimen

Native controls work. Demo links and submissions stay inside this specimen.

Source markup
<!-- @dsCard group="Display" height=616 -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Table</title>
<style>
  /* Layout of the demo states only. */
  .demo { display: flex; flex-direction: column; gap: var(--space-sm); max-width: 960px; }
  /* .nz-table-scroll carries margin-top: var(--space-xl) for section flow.
     Zeroed here so the card keeps its marker height. */
  .demo .nz-table-scroll { margin-top: 0; }
  .demo .rate-wrap { max-width: 640px; }
</style>
</head>
<body>
<div class="demo">

  <p class="t-label">Comparison table, sticky mono header</p>

  <div class="nz-table-scroll" tabindex="0" role="region" aria-label="Service comparison">
    <table class="nz-table">
      <thead>
        <tr>
          <th scope="col">Service</th>
          <th scope="col">Self-hosted</th>
          <th scope="col">End-to-end encrypted</th>
          <th scope="col">Federates</th>
          <th scope="col">Price</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="row" class="nz-td-name">Noiz &lt; Send<span class="nz-td-sub">encrypted file transfer</span></th>
          <td><span class="nz-pill nz-pill--y">Yes</span></td>
          <td><span class="nz-pill nz-pill--y">Yes</span></td>
          <td><span class="nz-pill nz-pill--n">No</span></td>
          <td class="nz-muted">on request</td>
        </tr>
        <tr class="nz-row--flag">
          <th scope="row" class="nz-td-name"><span class="sr-only">Recommended</span>Noiz &lt; Nextcloud<span class="nz-td-sub">files, calendar, contacts</span></th>
          <td><span class="nz-pill nz-pill--y">Yes</span></td>
          <td><span class="nz-pill nz-pill--p">Partial</span></td>
          <td><span class="nz-pill nz-pill--y">Yes</span></td>
          <td class="nz-muted">on request</td>
        </tr>
        <tr>
          <th scope="row" class="nz-td-name">Noiz &lt; PeerTube<span class="nz-td-sub">published video</span></th>
          <td><span class="nz-pill nz-pill--y">Yes</span></td>
          <td><span class="nz-pill nz-pill--n">No</span></td>
          <td><span class="nz-pill nz-pill--y">Yes</span></td>
          <td class="nz-muted">on request</td>
        </tr>
      </tbody>
    </table>
  </div>

  <p class="nz-table-note">Prices on request. The capability columns describe the software as Noiz runs it, not a roadmap.</p>

  <p class="t-label">Rate table</p>

  <div class="rate-wrap">
    <table class="rate-table">
      <thead>
        <tr>
          <th scope="col">Work</th>
          <th scope="col">Rate</th>
          <th scope="col">Unit</th>
          <th scope="col">Currency</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="row">Standard hours</th>
          <td class="rate-table__rate">On request</td>
          <td class="rate-table__unit">per hour</td>
          <td class="rate-table__fx">quoted in ZAR or EUR</td>
        </tr>
        <tr>
          <th scope="row">After hours</th>
          <td class="rate-table__rate">On request</td>
          <td class="rate-table__unit">per hour</td>
          <td class="rate-table__fx">quoted in ZAR or EUR</td>
        </tr>
      </tbody>
    </table>
  </div>

</div>
</body>
</html>

A comparison table for placing services or plans side by side, plus a narrow rate table for hourly work.

Use .nz-table to compare three or more things across the same columns. Use .rate-table for a short list of rates inside a card or body copy. Do not use either for layout, or for a single service: a .card says it in less space.

A .nz-table-scroll wrapper around <table class="nz-table">, so the 860px minimum width scrolls instead of squashing. Real <thead> and <tbody>, <th scope="col"> in the header and <th scope="row"> first in every row. The row label carries .nz-td-name and an optional <span class="nz-td-sub"> gloss. Values are .nz-pill spans or plain text; deferred ones take .nz-muted. A closing .nz-table-note carries the caveats. .rate-table needs no wrapper: it is fluid, its cells take .rate-table__rate, .rate-table__unit and .rate-table__fx.

The wrapper is capped at 70vh and scrolls both ways, so the header sticks to the top of the scroll container on a long table. It is set in font-family-mono at font-scale-label with font-tracking-label, color-semantic-text-muted on color-semantic-bg-secondary. The rule under it is color-semantic-border-base; rules between rows are the softer color-semantic-border-soft, giving the two-tier structure. One row may take .nz-row--flag: an amber wash from color-semantic-accent-primary, a 3px inset bar on the first cell, the name in the accent. Pills read color-semantic-accent-primary on color-amber-medium for yes, color-semantic-status-warning for partial, color-semantic-text-muted for no.

  • Role: a native <table>, no ARIA role on it. The .nz-table-scroll wrapper takes role="region" with tabindex="0".
  • Name: the wrapper’s aria-label names the table; cells by their <th scope="col"> and <th scope="row">. A flagged row names the flag in an .sr-only span in its first cell, because color-semantic-accent-primary alone carries it.
  • Keyboard: nothing inside is interactive. Tab reaches the scroll region, arrows scroll it; Enter, Space and Escape do nothing.
  • Target size: no controls, so SC 2.5.8 binds nothing here; the one focus target, the region, fills its column.
  • Announcement: none; nothing updates in place.

Flag one row only, and pair the wash with the .sr-only name. The flag is the accent here: no glow, no second highlight. The wash is translucent, not a fill: cells keep color-semantic-text-secondary, the name color-semantic-accent-primary. Reserve color-semantic-text-on-accent for solid accent fills. Never colour a pill with color-semantic-text-faint. “On request” in .nz-muted is the honest cell.

Hand-written from themes/noiz/assets/css/components.css (.nz-table, .nz-td-name, .nz-row–flag, .nz-pill, .rate-table).