Skip to main content
Raasta
SeriousWCAG 1.3.1 · Level Ath-has-data-cells

Table header has no data cells

A table header (<th>) with no data cells under or beside it, usually because data cells were marked up as headers or the table is empty, gives screen reader users headers for nothing. Use <th> only for real row or column headers and <td> for the data, and don’t show an empty table.

Who it hurts

Screen reader users, who rely on headers being read out as they move between cells.

Spec tables built with <th> on both sides for bold text, and order tables shown with no rows, are the usual cases.

How to fix it

Pick your stack. Review every change before you ship it.

Before

<tr><th>Size</th><th>Chest</th></tr>
<tr><th>S</th><th>91 cm</th></tr>

After

<tr><th scope="col">Size</th><th scope="col">Chest</th></tr>
<tr><th scope="row">S</th><td>91 cm</td></tr>

Check it by hand too

Move through the table cell by cell with a screen reader. Each data cell should be read with the right row and column headers.

Automated checks find a large share of accessibility problems, but not all of them. Passing this check does not on its own make a page compliant.

WCAG reference