Tables
Tabular data forms a crucial part of business information presentation. Tables allow users to quickly comprehend and compare large data volumes.
| Library | Versatility | Simplicity | Recognizability | Score |
|---|---|---|---|---|
| Tailwind | V | X | X | 1 |
| Bootstrap | V | X | V | 2 |
| Rare Styles | V | V | V | 3 |
Tables default to min-width: 100%, occupying the full width of their parent element. When a table is wider than its column, wrap it in .table-scroll so it scrolls horizontally instead of breaking the layout grid — overflow-x has no effect on the table element itself. Inside the box, code in a cell keeps its shape: an option name never breaks mid-word on a phone — the table grows and the box scrolls. In the first column, which holds the keys, a class or token name does not break at a hyphen either. On paper, which does not scroll, the code breaks again so the table fits the page.
For small tables and table-style data presentation, the .table-small selector is available with left-aligned content.
Always remember the primary purpose of tables: presenting data for quick analysis and comparison. Don't overload tables with unnecessary information or use them for content better presented as text or graphics.
To limit table width, use either parent elements or preset spacing selectors like .width-50, .mobile:width-75, etc., or create custom classes.
A table wider than its column — a note on a tablet is often one — goes in a .table-scroll wrapper: it scrolls inside the box instead of widening the page.
A table that hangs into the outdent, with .text-content-caption, .full-width-caption or .card-caption on it or on its box, steps its first column back in by the outdent (32px, 8px on a phone), so the row labels stay on the text edge. In a card, a panel or a collapsible nothing hangs, and the column stays as it is.
Preset Tables
For dashboards and other data-heavy pages, the library includes preset selectors. These allow you to quickly create readable tables with minimal code—like specialized table templates in your construction kit.
| Selector | Purpose |
|---|---|
.table-striped |
Alternating row backgrounds (zebra) |
.table-terminal |
Monospace metrics readout: columns 8px apart, no padding on the outer edges, value rows flush (4px above and below in a .table-striped table); centered values, last column right-aligned |
.table-comparison |
Centers value columns for scanning across options; row label stays left |
.table-numeric |
Tabular figures, value columns right-aligned for comparing numbers down a column |
.table-horizontal-borders |
Quiet rules between rows, no outer frame |
.table-small |
Compact, fit-content, left-aligned |
.table-bordered |
Full grid with outer frame and header band |
.table-section |
A group row inside .table-bordered (on the <tr>) |
.table-scroll |
Wrapper (not a table class) — lets a wide table scroll horizontally |
.table-terminal example:
| Visitors: | 1,234 |
| Clicks: | 345 |
| Leads: | 123 |
| Sales: | 12 |
| Revenue: | $1,234 |
| Conversion: | 1% |
Comparison tables
.table-comparison left-aligns the first column (the row label) and centers every value column under its header, so the reader scans straight down each option. Use it for feature or option comparisons in normal body type — reach for .table-terminal instead when the values are numeric and benefit from a monospace readout.
| Library | Versatility | Simplicity | Recognizability |
|---|---|---|---|
| Tailwind | Yes | No | No |
| Bootstrap | Yes | No | Yes |
| Rare Styles | Yes | Yes | Yes |
The example above also carries .table-horizontal-borders: a lighter alternative to .table-bordered that draws a quiet rule between rows without the outer frame or vertical lines. The two border presets are mutually exclusive — pick the frame weight the data needs.
Numeric tables
.table-numeric is the preset for decision-grade figures: it switches the table to tabular figures (every digit the same width, so numbers line up vertically) and right-aligns the value columns while the row label stays left. Use it for financial tables, KPI readouts, and any data where the reader compares numbers down a column. It keeps the normal text font — reach for .table-terminal when you want a monospace readout.
| Channel | Sessions | Conversion | Revenue |
|---|---|---|---|
| Organic search | 48,120 | 3.4% | $182,400 |
| Paid social | 9,265 | 1.1% | $24,900 |
| Direct | 121,008 | 5.0% | $540,150 |
Group rows
A long reference table — the options of a chart, the fields of an API — reads faster in groups. Inside a .table-bordered, a row with .table-section is a group heading: one cell across every column with an h5 (or h6) and, if the group needs it, a line of text. The row drops its bottom rule, so the heading belongs to the rows under it, and the heading and the text lose their margins inside the cell. The text runs the full width of the row: a data table is outside the prose measure.
| Option | Type | Default | Description |
|---|---|---|---|
Layout |
|||
height | number | 240 | Chart height in px. Width is always 100% of the container. |
yAxisPosition | 'left' | 'right' | 'right' | The side the Y axis sits on. |
LegendEvery legend option is optional; without them the chart draws no legend. |
|||
legend | array | — | Items with a label and a type. |
legendPosition | 'top' | 'right' | 'top' | Above the chart, or in a column beside it. |
<tr class="table-section">
<td colspan="4">
<h5>Legend</h5>
<p>Every legend option is optional.</p>
</td>
</tr>
The example is the reference-table recipe the chart docs use: .table-bordered with group rows, inside .table-scroll. In the scroll box an option name in code never breaks mid-word: on a phone the table keeps its columns and the box scrolls. There is no separate preset class for it — the three pieces are the preset. A Markdown table cannot take a class: write a reference table as HTML.
Table or .dl-grid?
Two columns of key: value metadata — version, status, owner — read better as a .dl-grid definition list. Reach for a table once there are three or more columns, or when rows are meant to be compared against each other rather than read as individual facts.