# Scope Attr Valid

> The scope attribute should be only used on permitted elements and have a valid value.

Source: https://knowledge.evinced.com/web/web-validations/scope-attr-valid

The `scope` attribute should be only used on permitted elements and have a valid value.

The `scope` attribute connects header cells to the row or column they describe, letting assistive technology announce the correct header as users move through data tables. When the attribute appears on the wrong element or carries an unexpected value, screen-reader navigation may become confusing and inefficient. Following the permitted element–value pairs keeps table navigation predictable across browsers and assistive technology. In HTML5 documents (`<!DOCTYPE html>`), the `scope` attribute is allowed only on `<th>` elements; older HTML versions also allowed it on `<td>`. Allowed values for the `scope` attribute are: `row`, `col`, `rowgroup`, or `colgroup`.

## Pass Patterns

### Valid `scope` attributes

`scope` attributes are on allowed elements and have valid values.

```html
<!DOCTYPE html>


<table>
    <tr>
        <th scope="col">Name</th>
        <th scope="col">1 mile</th>
        <th scope="col">5 km</th>
    </tr>
    <tr>
        <th scope="row">Mary</th>
        <td>8:32</td>
        <td>28:04</td>
    </tr>
</table>
```

## Fail Patterns

### `scope` attribute on a `<td>` element

`scope` appears on a data cell, so assistive technology ignores it.

```html
<!DOCTYPE html>


<td scope="row">8:32</td>
```

### Invalid `scope` value

The value is not one of the four permitted keywords, so the association breaks.

```html
<!DOCTYPE html>


<th scope="column">Name</th>
```

## Try It Yourself

### Using a screen reader

**New to screen reader testing, or need a refresher?**  
Review this article first: [Practical guides for using screen readers](https://knowledge.evinced.com/a11y-essentials/practical-guides-for-using-screen-readers)

1.  Load the page and open a screen reader, then move focus into the data table.
2.  Navigate between the rows and columns.

**Expected result:** When you move between cells, the screen reader announces the correct row and column headers.

**Actual result:**

-   *`scope` on a `<td>`:* the screen reader ignores the attribute, so the header isn't announced.
-   *`row`/`col` values swapped:* the screen reader's output is unpredictable and depends on how the table's other headers are defined.

## FAQ

**Why is this validation considered a best practice?**

While not mandated by WCAG, properly scoped headers greatly improve keyboard and screen-reader navigation.

**Why is this issue marked as Moderate?**

Incorrect scope use usually confuses table navigation rather than blocking it entirely. Users can still reach every cell, but they may lose contextual information, forcing extra effort to understand the data, particularly for large tables or when using assistive technology.

## Standards and Regulations

This issue is classified as "**Best Practice**," meaning it isn't tied to a specific WCAG success criterion or any other regulation or standard; however it still affects the experience of some users. These issues fall outside formal compliance requirements, yet addressing them improves usability and accessibility in practice.

## Personas impacted by this issue

-   [Screen Reader](https://knowledge.evinced.com/a11y-essentials/personas#screen-reader)
-   [Braille](https://knowledge.evinced.com/a11y-essentials/personas#braille)

## Learn More

-   [W3C’s Tables Tutorial](https://www.w3.org/WAI/tutorials/tables/)

## Related Issues

-   [table-duplicate-name](https://knowledge.evinced.com/web/web-validations/table-duplicate-name)
-   [empty-table-header](https://knowledge.evinced.com/web/web-validations/empty-table-header)
-   [th-has-data-cells](https://knowledge.evinced.com/web/web-validations/th-has-data-cells)
-   [td-headers-attr](https://knowledge.evinced.com/web/web-validations/td-headers-attr)
