fin1te/dsv1.0.0
  1. ds
  2. Components
  3. Table

Table

Data tables with mono heads and tabular numbers.

JobEnginep50Memory
SessionizeSpark41 s48 GB
SessionizeRust13 s14 GB
DedupeRust6 s3 GB
Code
<div class="table-wrap">
<table class="table">
  <thead><tr><th>Job</th><th>Engine</th><th class="n">p50</th><th class="n">Memory</th></tr></thead>
  <tbody>
    <tr><td>Sessionize</td><td><span class="chip">Spark</span></td><td class="n">41 s</td><td class="n">48 GB</td></tr>
    <tr><td>Sessionize</td><td><span class="chip warm">Rust</span></td><td class="n">13 s</td><td class="n">14 GB</td></tr>
    <tr><td>Dedupe</td><td><span class="chip warm">Rust</span></td><td class="n">6 s</td><td class="n">3 GB</td></tr>
  </tbody>
</table>
</div>

Heads are small mono uppercase, rows are separated by hairlines, numbers are right-aligned in mono with tabular figures. Inside .prose, plain tables get the same look and every column after the first is right-aligned.

Compact

Regionap-south-1
Nodes12
Uptime99.97%
Code
<table class="table compact" style="max-width:24rem">
  <tbody>
    <tr><td>Region</td><td class="n">ap-south-1</td></tr>
    <tr><td>Nodes</td><td class="n">12</td></tr>
    <tr><td>Uptime</td><td class="n">99.97%</td></tr>
  </tbody>
</table>
ClassOnWhat it does
.tabletableThe base table.
.nth, tdRight-aligned mono number.
.compact.tableTighter rows, smaller text.
.table-wrapdivScrolls wide tables sideways on phones.

Accessibility

  • Use <th> in the head so screen readers announce columns. Add scope="row" to row headers.