Skip to main content
Checks that table headers have associated data cells
Rule IDa11y/th-has-data-cells
CategoryAccessibility
ScopePer-page
Severitywarning
Weight4/10

Solution

Each <th> element should be associated with at least one <td> data cell in the same row or column. Orphaned header cells without data cells usually indicate the table is being misused for layout purposes. If the table is for layout, add role=‘presentation’. Otherwise, ensure every header has corresponding data cells.

Enable / Disable

Disable this rule

squirrel.toml
[rules]
disable = ["a11y/th-has-data-cells"]

Disable all Accessibility rules

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

Enable only this rule

squirrel.toml
[rules]
enable = ["a11y/th-has-data-cells"]
disable = ["*"]