TH Has Data Cells
Checks that table headers have associated data cells
Checks that table headers have associated data cells
| Rule ID | a11y/th-has-data-cells |
| Category | Accessibility |
| Scope | Per-page |
| Severity | warning |
| Weight | 4/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
[rules]
disable = ["a11y/th-has-data-cells"]
Disable all Accessibility rules
[rules]
disable = ["a11y/*"]
Enable only this rule
[rules]
enable = ["a11y/th-has-data-cells"]
disable = ["*"]