Skip to content
Signal

Components

Table

Data tables with a muted header row; wrap in .ct-table-wrap to scroll sideways.

Live example

Rendered with the real classes from /site/chitransit.css, light (left) and dark (right).

KeyCallsShare
ios41,20062%
web9,87015%
.ct-table-wrap · .ct-table--numeric

Code

<div class="ct-table-wrap"><table class="ct-table ct-table--numeric"><tr><th>Key</th><th>Calls</th><th>Share</th></tr><tr><td>ios</td><td>41,200</td><td>62%</td></tr><tr><td>web</td><td>9,870</td><td>15%</td></tr></table></div>

Tokens

From tokens/components.tokens.json. Override one instance by setting the property without the ct- prefix.

Custom propertyValueAlias
--ct-table-cell-padding-xvar(--space-12){space.s12}
--ct-table-cell-padding-yvar(--space-10){space.s10}
--ct-table-font-size14px
--ct-table-head-backgroundvar(--card){colors.card}
--ct-table-head-colorvar(--muted){colors.muted}
--ct-table-head-font-sizevar(--fs-cap){type.cap}
--ct-table-head-tracking.04em
--ct-table-rulevar(--line){colors.line}

Usage

Do

  • Wrap a table in .ct-table-wrap so it scrolls sideways on narrow screens.
  • Use --numeric to right-align digits with tabular figures.

Don't

  • Don't use tables for layout.

Accessibility

  • Use <th> for headers so screen readers announce them per cell.