⚠️ Design system CSS not found. Check the path in cms/docs.config.js → designSystemPath, then re-run npm run docgen.

Table

Structured data in rows and columns

Design System / Table
Download .md file
Open .md in new tab

Tables use a composable architecture with a base class and optional modifiers. The base style is minimalistic, clean borders, no background fills, and modifiers layer on additional behaviour.

Structure

Every table needs two elements:

  1. A scroll wrapper () for horizontal overflow on small screens
  2. The table element with the base class
Name Type Status
Alpha Primary Active
Beta Secondary Pending
Gamma Tertiary Inactive
<div class="table-scroll">
  <table class="table">
    <thead>
      <tr>
        <th>Column</th>
        <th>Column</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>Data</td>
        <td>Data</td>
      </tr>
    </tbody>
  </table>
</div>

Base Class

The class provides the default minimalistic style:

Property Value
Border collapse collapse
Width fit-content (max 100%)
Font size
Font variant tabular-nums
Header background Transparent
Header border var(--border-s) solid var(--border-secondary)
Body row border var(--border-s) solid var(--border-faded)
Cell padding var(--space-m) var(--space-l)

Modifiers

Modifiers are added alongside on the <table> element. They can be combined freely.

Class Effect
Sets width to 100%
Adds hover highlight on body rows
Adds background colour to header cells

Full Width

NameRole
AliceDesigner
BobDeveloper
<table class="table table-full">

Hoverable Rows

NameRole
AliceDesigner
BobDeveloper
CarolManager
<table class="table table-hover">

Filled Header

NameRole
AliceDesigner
BobDeveloper
<table class="table table-header-filled">

Footer

The <tfoot> element is styled automatically when inside a :

  • Top border: var(--border-m) solid var(--border-primary)
  • Header cells: bold weight
  • Data cells: semi-bold weight
ItemPrice
Widget£50
Gadget£75
Total£125
<table class="table table-full">
  <thead>
    <tr><th>Item</th><th>Price</th></tr>
  </thead>
  <tbody>
    <tr><td>Widget</td><td>£50</td></tr>
  </tbody>
  <tfoot>
    <tr><th>Total</th><td>£50</td></tr>
  </tfoot>
</table>

Combining Modifiers

Modifiers compose naturally. A full-featured table with hover, filled header, and footer:

ItemQtyPrice
Widget2£100
Gadget1£75
Doohickey3£60
Total6£235
<div class="table-scroll">
  <table class="table table-full table-hover table-header-filled">
    <thead>...</thead>
    <tbody>...</tbody>
    <tfoot>...</tfoot>
  </table>
</div>

Responsive Behaviour

Tables are mobile-friendly by default:

  • Horizontal scroll: allows swiping when the table is wider than the viewport
  • Scroll hint: a subtle fade appears on the right edge when the table overflows, indicating more content. It disappears once the user scrolls to the end
  • Condensed padding: at 768px and below, cell padding and font size reduce automatically to fit more content on screen

No extra classes or markup are needed. This behaviour is built into and .


Markdown Tables

Tables generated from markdown (via the doc generator) automatically receive the class inside a wrapper. No manual class application is needed for documentation pages.


Usage rules

Don't

  • Don't apply spacing or margins to directly. Use the scroll wrapper or parent block for spacing
  • Don't create combined classes like . Compose existing modifiers instead
  • Don't hardcode border or colour values. Use the design system tokens

CSS reference

This section documents how the component is built. For usage, see the sections above.

Styling

Property Value
Border collapse collapse
Width fit-content (max 100%)
Font size
Cell padding var(--space-m) var(--space-l)
Header weight
Header min width 130px
Header border var(--border-s) solid var(--border-secondary)
Body row border var(--border-s) solid var(--border-faded)
Footer border top var(--border-m) solid var(--border-primary)

Mobile (max-width: 768px)

Property Value
Cell padding var(--space-s) var(--space-m)

Selectors

Selector Purpose
Base table, collapsed borders, fit-content width
Sets width to 100%
.table-hover tbody tr:hover Row hover highlight,
.table-header-filled th Filled header cells, background, semi-bold
.table tfoot tr Footer row, heavier top border
Horizontal overflow wrapper with touch scrolling
.table-scroll.is-overflowing Adds right-edge fade hint when content overflows
.table-scroll.is-scrolled-end Removes fade hint when scrolled to end
On this page
  • Structure
  • Base Class
  • Modifiers
  • Footer
  • Combining Modifiers
  • Responsive Behaviour
  • Markdown Tables
  • Usage rules
  • CSS reference
Previous

Divider

Next

Code

Was this page helpful?

We use this feedback to improve our documentation.

Thanks for your feedback

Send feedback

© 2026 By Default