Skip to content

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.
  • People who use a screen reader or a braille display, most of them blind.

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.

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>.

axe-core’s documentation of the rule

CORA’s fix guidance adapts content from accessibility-agents, under the MIT License: see its notice.