On this page

Table

Keys, what Table gives you and what your team does.

Conformance

Table meets WCAG 2.2 level AA when used as described on these pages. It is a native HTML table, so screen readers announce rows, columns and headers.

Keyboard

Key Action
Tab Moves to the next link, button or checkbox in the table. Rows themselves take no focus.
Shift + Tab Moves back.

A wide table scrolls sideways inside its container; people scroll with the mouse, touch, or by moving focus to a control inside.

What Table gives you

  • table, thead, tbody, th and td, so each cell is read with its column header.
  • A selected row has a second cue (the bar at its start) beside the fill, and the bar reaches 3:1 on the selected fill (D24).
  • Header text and cell text at least 7:1 (D4).
  • The row-link overlay is out of the tab order (tabindex="-1"), so a linked row does not add a focus stop per cell.

What your team does

  • Use TableHead for every column header, and TableCaption or a heading next to the table to say what it lists.
  • For a linked row, also put a real link on the row’s name: the overlay is for pointer users and is not reachable by keyboard.
  • Give each selection checkbox a name (“Select Oolong tea, 250 g”), and give the select column header a visually hidden name.
  • Set aria-selected on rows only when the table is an interactive grid; otherwise the checkbox carries the state.
  • Wrap long values with break-all; don’t cut them with an ellipsis.

WCAG criteria

Criterion Level How
1.3.1 Info and Relationships A Native table markup with headers
1.4.1 Use of Color A Selected rows have a bar as well as a fill
1.4.3 Contrast (Minimum) AA Text at least 7:1
1.4.10 Reflow AA Wide tables scroll inside their container, not the page
1.4.11 Non-text Contrast AA The selected bar reaches 3:1
2.1.1 Keyboard A Every action in a row is a focusable control