Table headers in table are invalid
| Field | Value |
|---|---|
| Rule code | Manual_TableHeader_Invalid |
| WCAG conformance level | A |
| WCAG success criterion | 1.3.1 Info and Relationships |
| Must be fixed at source | No |
Description
Invalid table headers have been detected in a table element. Properly defined table headers allow for Screen Readers to properly parse and read the contents of the tabular data. Without valid headers, users may struggle to understand the relationships between the table data and its headings.
How to fix
Ensure table headers are correctly defined using <th> elements for header cells and specify scope attributes, such as scope="col" for column headers and scope="row" for row headers. For example: <table><tr><th scope="col">Header 1</th><th scope="col">Header 2</th></tr><tr><td>Data 1</td><td>Data 2</td></tr></table>.