# jsx-a11y/scope

> Disallow the `scope` attribute on elements other than `<th>`

`scope` tells a screen reader whether a header cell names its column or its row. It only means something on `<th>`. On a `<td>` or anything else it's ignored, so the cell you meant as a header is read as ordinary data.

Components aren't checked.

`--fix` removes the attribute. If the cell is a header, change it to a `<th>` instead.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

Off by default. To turn it on:

```toml bunfig.toml
[lint.rules]
"jsx-a11y/scope" = "error" # or "warn"
```

{/* End of the generated section. */}

## Examples

Reported:

{/* bad */}
```jsx
const row = (
  <tr>
    <td scope="row">Total</td>
    <td>{total}</td>
  </tr>
);
```

Not reported:

{/* good */}
```jsx
const row = (
  <tr>
    <th scope="row">Total</th>
    <td>{total}</td>
  </tr>
);
```
