incorrect-header-data-association
Rule Severity : Moderate
Description
Data cells (<td>
) in tables must be correctly associated with their corresponding header cells (<th>
) to ensure proper navigation for screen reader users. Incorrect associations can make tables difficult to understand for users relying on assistive technologies.
The incorrect-header-data-association
rule aligns with WCAG Success Criterion 1.3.1 (Info and Relationships), which requires that information, structure, and relationships conveyed through presentation must be programmatically determinable.
Examples
In the following example, a data cell lacks a proper association with its header, making it unclear for screen reader users.
In the corrected example, the scope
attribute is used to associate headers with their corresponding data cells:
How to fix?
To fix violations of the incorrect-header-data-association
rule, follow these steps:
- Ensure every
<th>
has a properscope
attribute (col
,row
,colgroup
, orrowgroup
). - For complex tables, use headers and id attributes to explicitly link data cells to their headers.
Reference
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!