td-headers-attrTable cell points to headers that don’t exist
A cell whose headers attribute lists ids that aren’t header cells in the same table, or its own id, is read with the wrong headers or none. Point headers only at the ids of <th> cells in that table, or remove it and use scope on the <th> cells instead.
Who it hurts
Screen reader users, who hear the wrong context for numbers and prices in complex tables.
Usually happens when a table is copied, or ids are renamed, and the headers lists aren’t updated.
How to fix it
Pick your stack. Review every change before you ship it.
Before
<th>Price</th>
…
<td headers="price">£20</td>After
<th id="price">Price</th>
…
<td headers="price">£20</td>Check it by hand too
Move through the table cell by cell with a screen reader. Each data cell should be read with its correct 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
- 1.3.1 Info and Relationships (Level A). Understanding 1.3.1