incorrect-data-headers-cell
Rule Severity : Moderate
Description
Table headers and data cells must be correctly identified using appropriate markup (<th>
, <td>
) or ARIA roles. Incorrectly marked tables can confuse users of screen readers and other assistive technologies.
The incorrect-data-headers-cell
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, table headers are incorrectly marked as data cells (<td>
).
In the corrected example, headers are properly marked with <th>
:
How to fix?
To fix violations of the incorrect-data-headers-cell
rule, follow these steps:
- Identify table headers and ensure they are marked with
<th>
. - Use <td> for standard data cells.
- If ARIA roles are used, ensure
role="columnheader"
orrole="rowheader"
is applied appropriately.
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!