Tables
The plain table, with the modifiers for density and stickiness.
How to use it
Copy any example below and paste it in- Classes
.tableinside a.table-wrap, which is what makes it scroll instead of overflowing.- Modifiers
.table-striped,.table-compact,.table-stickyfor a stuck header.- Cells
.cell-numright-aligns and uses tabular figures;.cell-truncateclips a long value.- Status
- A status cell holds a
.pillwith a word in it, never a bare colour.
Striped, with status pills
| Invoice | Account | Amount | Status |
|---|---|---|---|
| INV-4825 | Lanternfish Co | $9,640 | Paid |
| INV-4823 | Harbour Logistics | $12,900 | Pending |
| INV-4824 | Quarry Media | $3,180 | Overdue |
<div class="table-wrap">
<table class="table table-striped">
<thead>
<tr>
<th>Invoice</th>
<th>Account</th>
<th class="text-end">Amount</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td class="font-mono text-xs">INV-4825</td>
<td>Lanternfish Co</td>
<td class="cell-num">$9,640</td>
<td><span class="pill pill-success">Paid</span></td>
</tr>
<tr>
<td class="font-mono text-xs">INV-4823</td>
<td>Harbour Logistics</td>
<td class="cell-num">$12,900</td>
<td><span class="pill pill-warning">Pending</span></td>
</tr>
<tr>
<td class="font-mono text-xs">INV-4824</td>
<td>Quarry Media</td>
<td class="cell-num">$3,180</td>
<td><span class="pill pill-danger">Overdue</span></td>
</tr>
</tbody>
</table>
</div>
Compact, with a sticky header
Scroll the panel to see the header stay.
<div class="table-wrap max-h-56 overflow-y-auto scrollbars">
<table class="table table-compact table-sticky">
<thead>
<tr><th>Rep</th><th>Territory</th><th class="text-end">Bookings</th></tr>
</thead>
<tbody>
<tr><td>Marco Breil</td><td>North</td><td class="cell-num">$312,000</td></tr>
<tr><td>Yuki Abe</td><td>South</td><td class="cell-num">$248,000</td></tr>
<tr><td>Petra Vance</td><td>East</td><td class="cell-num">$186,000</td></tr>
<tr><td>Idris Falk</td><td>West</td><td class="cell-num">$142,000</td></tr>
<tr><td>Nora Chen</td><td>Export</td><td class="cell-num">$60,000</td></tr>
<tr><td>Tobias Reed</td><td>North</td><td class="cell-num">$54,000</td></tr>
</tbody>
</table>
</div>