These docs are for CORA 0.10, an older release. Read this page in the newest docs.
Scope needs a valid value on a header cell
- Rule:
axe/scope-attr-valid - Checks: scope attribute should be used correctly
- WCAG: none; a best practice, not a WCAG success criterion
- Fix class:
mechanical: A fix needs no authored text or visual decision.
Who it affects
Section titled “Who it affects”- People who use a screen reader or a braille display, most of them blind.
How to fix it
Section titled “How to fix it”scope is on a <td>
Section titled “scope is on a <td>”If the cell names a row or column, make it a <th> and keep scope. If it holds data, remove scope.
<table> <caption>Opening hours</caption> <tr> <th scope="col">Day</th> <th scope="col">Hours</th> </tr> <tr> <th scope="row">Monday</th> <td>9:00 to 17:00</td> </tr></table>scope has a value other than row, col, rowgroup or colgroup, such as scope="column"
Section titled “scope has a value other than row, col, rowgroup or colgroup, such as scope="column"”Use col for a column header, row for a row header, and colgroup or rowgroup for a header that spans a group of columns or rows.
Fixes that fail
Section titled “Fixes that fail”Removing scope from a <td> that is really a header
Section titled “Removing scope from a <td> that is really a header”The rule passes, but assistive technology still treats the cell as data. Make it a <th>.
More on the rule
Section titled “More on the rule”axe-core’s documentation of the rule
CORA’s fix guidance adapts content from accessibility-agents, under the MIT License: see its notice.