Home

Tables

Usage

Tables provide presentation-focused layout for tabular data in documents. For typed data with column validation and structured datasets, see datatables.

Start with these tokens when customizing tables:

  • --table-spacing-top and --table-spacing-bottom for vertical rhythm

  • --table-max-width (plus mobile/print variants) for breakout width

  • --table-header-background and --table-header-font-weight for header emphasis

  • --table-row-striped and --table-row-hover for row scanning

  • --table-cell-padding and --table-cell-font-size for density

  • --table-border-width and --table-border-color for frame style

  • --table-caption-* and --table-notes-* for supporting text

Spacing derives from --content-spacing, and caption/notes typography aligns with the shared caption system. For typed data tables with column validation, use the datatable tokens instead.

Tokens

Layout Tokens

Control breakout width behavior for tables.

TokenDescriptionDefault Value
--table-max-widthMaximum width for tablesvar(--content-breakout-width)
--table-max-width-mobileMaximum width on mobile (640px)var(--content-breakout-width-mobile)
--table-max-width-printMaximum width in print100%

Spacing Tokens

Control vertical separation and layout spacing for tables.

TokenDescriptionDefault Value
--table-spacing-topTop margin (automatic responsive scaling)var(--content-spacing)
--table-spacing-bottomBottom margin (automatic responsive scaling)var(--content-spacing)
--table-caption-spacing-bottomGap between caption and tablevar(--caption-spacing)
--table-notes-spacing-topGap between table and notescalc(var(--content-spacing) * 0.5)

Caption Layout and Typography Tokens

Layout and typography styling for table captions (inherits from caption and label tokens).

TokenDescriptionDefault Value
--table-caption-font-familyFont family for captionsvar(--caption-font-family)
--table-caption-font-sizeFont size for captionsvar(--caption-font-size)
--table-caption-colorText color (automatic dark mode)var(--caption-color)
--table-caption-line-heightLine height for caption textvar(--caption-line-height)
--table-caption-alignText alignment (left, center, right, justify)var(--caption-align)
--table-caption-max-widthMaximum width for caption textvar(--caption-max-width)
--table-label-font-weightFont weight for table labelsvar(--label-font-weight)
--table-label-font-styleFont style for table labelsvar(--label-font-style)
--table-label-colorText color for table labelsvar(--label-color)

Notes Tokens

Styling for table notes and annotations.

TokenDescriptionDefault Value
--table-notes-font-familyFont family for notes textvar(--text-font-family)
--table-notes-font-sizeFont size for notes textcalc(var(--text-font-size) * 0.80)
--table-notes-colorText color for notesvar(--text-color-secondary)
--table-notes-line-heightLine height for notes textvar(--line-height-normal)
--table-notes-alignText alignment for notesleft

Table Container Tokens

Border and corner styling for the table container.

TokenDescriptionDefault Value
--table-border-radiusCorner roundingvar(--border-radius-default)

Border Tokens

Granular control over table borders enables classic typographic patterns like Tufte-style horizontal rules or Booktabs formatting.

Base Border Tokens

Foundation tokens that other border tokens inherit from:

TokenDescriptionDefault Value
--table-border-widthBase width for outer bordersvar(--border-width-default)
--table-border-width-printBase width for print media0
--table-border-colorBase color for outer bordersvar(--border-color-default)
--table-border-styleBase style for outer borderssolid

Outer Border Edge Tokens

Individual control for each edge of the table's outer border:

TokenDescriptionDefault Value
--table-border-top-widthTop edge border widthvar(--table-border-width)
--table-border-top-width-printTop edge width for printvar(--table-border-width-print)
--table-border-top-colorTop edge border colorvar(--table-border-color)
--table-border-top-styleTop edge border stylevar(--table-border-style)
--table-border-bottom-widthBottom edge border widthvar(--table-border-width)
--table-border-bottom-width-printBottom edge width for printvar(--table-border-width-print)
--table-border-bottom-colorBottom edge border colorvar(--table-border-color)
--table-border-bottom-styleBottom edge border stylevar(--table-border-style)
--table-border-left-widthLeft edge border widthvar(--table-border-width)
--table-border-left-width-printLeft edge width for printvar(--table-border-width-print)
--table-border-left-colorLeft edge border colorvar(--table-border-color)
--table-border-left-styleLeft edge border stylevar(--table-border-style)
--table-border-right-widthRight edge border widthvar(--table-border-width)
--table-border-right-width-printRight edge width for printvar(--table-border-width-print)
--table-border-right-colorRight edge border colorvar(--table-border-color)
--table-border-right-styleRight edge border stylevar(--table-border-style)

Row Border Tokens

Control borders between rows and after headers:

TokenDescriptionDefault Value
--table-row-border-widthBase width for row bordersvar(--border-width-default)
--table-row-border-width-printBase width for print mediavar(--border-width-default)
--table-row-border-colorBase color for row bordersvar(--border-color-default)
--table-row-border-styleBase style for row borderssolid
--table-header-border-bottom-widthBorder below header rowvar(--table-row-border-width)
--table-header-border-bottom-width-printHeader border width for printvar(--table-row-border-width-print)
--table-header-border-bottom-colorBorder color below headervar(--table-row-border-color)
--table-header-border-bottom-styleBorder style below headervar(--table-row-border-style)
--table-body-row-border-widthBorder between body rowsvar(--table-row-border-width)
--table-body-row-border-width-printBody row border width for printvar(--table-row-border-width-print)
--table-body-row-border-colorBorder color between body rowsvar(--table-row-border-color)
--table-body-row-border-styleBorder style between body rowsvar(--table-row-border-style)

Column Border Tokens

Control vertical borders between columns:

TokenDescriptionDefault Value
--table-column-border-widthVertical borders between columns0
--table-column-border-width-printColumn border width for print0
--table-column-border-colorVertical border colorvar(--border-color-default)
--table-column-border-styleVertical border stylesolid

Header Styling Tokens

Visual styling for table headers.

TokenDescriptionDefault Value
--table-header-backgroundBackground color for headersvar(--surface-sunken)
--table-header-background-darkBackground color for dark modevar(--surface-sunken-dark)
--table-header-background-printBackground color for printtransparent
--table-header-font-weightFont weight for header textvar(--font-weight-semibold)

Row Styling Tokens

Interactive and striping behavior for table rows.

TokenDescriptionDefault Value
--table-row-hoverBackground color on hovervar(--color-gray-50)
--table-row-hover-darkHover background color for dark mode#303030
--table-row-stripedBackground color for even rowstransparent
--table-row-striped-darkStriped background for dark modetransparent
--table-row-striped-printStriped background for print (transparent saves ink)transparent

Cell Styling Tokens

Typography and spacing for table cells.

TokenDescriptionDefault Value
--table-cell-font-familyFont family for cell textvar(--text-font-family)
--table-cell-font-sizeFont size for cell textcalc(var(--text-font-size) * 0.85)
--table-cell-line-heightLine height for cell textvar(--line-height-normal)
--table-cell-line-height-mobileLine height on mobilevar(--line-height-tight)
--table-cell-line-height-printLine height for printvar(--line-height-tight)
--table-cell-paddingCell paddingvar(--space-2)
--table-cell-padding-mobileCell padding on mobilevar(--space-1)
--table-cell-padding-printReduced padding for printvar(--space-xs)

Examples

Default Tables

Standard table styling with automatic responsive spacing and dark mode support:

:root {
  /* No design token overrides */
}
NameValueStatus
Alpha42Active
Beta17Pending
Gamma89Active
Delta33Closed

Scholarly Article Tables

Enhanced spacing and typography for formal academic documents:

:root {
  --table-spacing-top: calc(var(--content-spacing) * 2);
  --table-spacing-bottom: calc(var(--content-spacing) * 2);
  --table-caption-spacing-bottom: var(--content-spacing);
  --table-caption-align: justify;
  --table-caption-line-height: var(--line-height-md);
}

Table 1: Summary of experimental results showing treatment effects across three independent trials. Values represent mean ± standard deviation with significance levels indicated.

TreatmentTrial 1Trial 2Trial 3p-value
Control12.3±2.111.8±1.912.6±2.3
Drug A18.7±3.219.1±2.818.3±3.5< 0.001
Drug B15.4±2.616.2±2.415.8±2.9< 0.01

Tables with Multi-Paragraph Captions

Tables supporting longer, detailed captions with multiple paragraphs:

:root {
  --table-caption-line-height: var(--line-height-md);
  --table-caption-spacing-bottom: var(--space-6);
}

Table 2: Comparison of algorithm performance across three benchmark datasets. Execution time measured in milliseconds on standardized hardware.

All tests were conducted with identical parameters and repeated 100 times. The values shown represent median execution time with 95% confidence intervals.

AlgorithmDataset ADataset BDataset C
Method 123±2 ms45±4 ms67±5 ms
Method 218±1 ms38±3 ms55±4 ms
Method 331±3 ms52±5 ms78±6 ms

Tables with Notes

Tables with annotations and additional context below the data:

:root {
  --table-notes-spacing-top: var(--space-4);
  --table-notes-font-size: var(--font-size-xs);
}

Table 3: Population statistics by region for 2023-2024.

RegionPopulationGrowthDensity
North2,450,0001.2%145/km²
South1,875,0002.8%98/km²
East3,120,0000.9%201/km²
West1,650,0001.5%87/km²

Tufte-Style Tables

Classic horizontal rules only (top and bottom borders, separator under header, no vertical lines):

:root {
  /* Outer borders - top and bottom only */
  --table-border-top-width: 1px;
  --table-border-bottom-width: 1px;
  --table-border-left-width: 0;
  --table-border-right-width: 0;

  /* Header separator - single rule below header */
  --table-header-border-bottom-width: 1px;

  /* Body rows - no interior borders */
  --table-body-row-border-width: 0;
  --table-column-border-width: 0;

  /* Minimal styling */
  --table-header-background: transparent;
  --table-row-hover: transparent;
  --table-cell-padding: var(--space-3);
}
MeasureMeanSDRange
Temperature22.41.818.2-26.1
Humidity65.38.252.1-78.5
Pressure101.30.7100.1-102.5

Booktabs-Style Tables

Thick rules at top and bottom, thin rule under header:

:root {
  /* Thick outer borders */
  --table-border-top-width: 2px;
  --table-border-bottom-width: 2px;
  --table-border-left-width: 0;
  --table-border-right-width: 0;

  /* Thin header separator */
  --table-header-border-bottom-width: 1px;

  /* No interior borders */
  --table-body-row-border-width: 0;
  --table-column-border-width: 0;

  /* Clean styling */
  --table-header-background: transparent;
  --table-header-font-weight: var(--font-weight-semibold);
}
CategoryCountPercentage
Type A14235.5%
Type B19849.5%
Type C6015.0%

Tips

Headers and striping: Use --table-header-background and --table-row-striped (with -dark variants) to improve scanability.

Row interactions: Set --table-row-hover to add or remove hover feedback without custom CSS.

Captions and notes: Use --table-caption-* and --table-notes-* to match the shared caption/label system.

Borders: Use edge-specific tokens like --table-border-top-width and --table-border-bottom-width for booktabs-style rules without custom selectors.

© 2026 Stencila