Skip to main content
Checks that data tables have proper headers
Rule IDa11y/table-headers
CategoryAccessibility
ScopePer-page
Severitywarning
Weight4/10

Solution

Data tables need proper headers for screen reader users to understand relationships. Use <th> for header cells, not styled <td>. Add scope=‘col’ or scope=‘row’ to clarify header direction. For complex tables, use id and headers attributes to associate data cells with headers. Include a <caption> to describe the table’s purpose. Layout tables should have role=‘presentation’.

Enable / Disable

Disable this rule

squirrel.toml
[rules]
disable = ["a11y/table-headers"]

Disable all Accessibility rules

squirrel.toml
[rules]
disable = ["a11y/*"]

Enable only this rule

squirrel.toml
[rules]
enable = ["a11y/table-headers"]
disable = ["*"]