Skip to content

header-scope

Reports a <th> with no scope (row, col, rowgroup or colgroup) in a table that is not a simple one. A table with a single row or a single column of headers is simple (WCAG H63).

In a table with headers on both axes a screen reader cannot tell whether a header belongs to the cells beside it or below it, so a cell is read with the wrong header.

To fix, add the scope that says which cells the header describes.

Reported
...
<form><button>go</button></form>
<form id="f"></form><button form="f">go</button>
<table><tr><th>a</th><th>b</th></tr><tr><td>1</td><td>2</td></tr></table>
<table><tr><th></th><th scope="col">b</th></tr><tr><th>c</th><td>2</td></tr></table>
...
<div aria-hidden="true"><button tabindex="-1">x</button></div>
</body>
...
angular:
lint:
rules:
header-scope: warn # off (default), warn, error
html:
lint:
rules:
header-scope: warn # off (default), warn, error
svelte:
lint:
rules:
header-scope: warn # off (default), warn, error
vue:
lint:
rules:
header-scope: warn # off (default), warn, error

Enabled by the presets: html/html-validate-recommended.

Suppress one line with sudsy-disable-next-line header-scope in a comment of the file’s language.

The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.

Tool Rule Match What differs
html-validate wcag/h63 partial the non-strict mode only, simple tables (one header row or one header column without thead) are left alone