URL: /rules/a11y/td-headers-attr

---
title: "Table Cell Headers"
description: "Checks that td headers attribute references valid th ids"
---

Checks that td headers attribute references valid th ids

| | |
|---|---|
| **Rule ID** | `a11y/td-headers-attr` |
| **Category** | [Accessibility](/rules/a11y) |
| **Scope** | Per-page |
| **Severity** | error |
| **Weight** | 6/10 |

## Solution

When using the headers attribute on `<td>` elements to associate cells with headers, ensure each id in the headers attribute matches an existing `<th>` element's id in the same table.

## Enable / Disable

### Disable this rule

```toml squirrel.toml
[rules]
disable = ["a11y/td-headers-attr"]
```

### Disable all Accessibility rules

```toml squirrel.toml
[rules]
disable = ["a11y/*"]
```

### Enable only this rule

```toml squirrel.toml
[rules]
enable = ["a11y/td-headers-attr"]
disable = ["*"]
```
