Table Headers
Checks that data tables have proper headers
Checks that data tables have proper headers
| Rule ID | a11y/table-headers |
| Category | Accessibility |
| Scope | Per-page |
| Severity | warning |
| Weight | 4/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
toml[rules]
disable = ["a11y/table-headers"]Disable all Accessibility rules
squirrel.toml
toml[rules]
disable = ["a11y/*"]Enable only this rule
squirrel.toml
toml[rules]
enable = ["a11y/table-headers"]
disable = ["*"]