Table headers in a data table must refer to data cells

How to fix the th-has-data-cells accessibility rule. Tables.

What this rule checks

Ensure that <th> elements and elements with role=columnheader/rowheader have data cells they describe

Who is affected

A table header doesn't describe any cells, which confuses screen-reader table navigation.

How to fix it

Make sure every <th> labels real data cells, or change it to <td>.

WCAG success criteria

When this rule fails, the page fails:

Find it on your own page

Scan a web page and the report lists every element that fails this rule, with screenshots outlining where they are, the code, and a selector you can paste into your browser’s developer tools.

More detail