# The “cell” role is unnecessary for element “td”.

> Canonical HTML version: https://rocketvalidator.com/html-validation/the-cell-role-is-unnecessary-for-element-td
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

A `<td>` in a data table already has the implicit ARIA role `cell`, so writing `role="cell"` on it gives screen readers nothing they don't already get from the HTML.

Browsers map table markup to ARIA roles on their own. The `<table>` becomes a table, each `<tr>` a row, each `<th>` a column or row header, and each `<td>` a cell. Screen readers use that structure to announce the matching headers as someone moves from cell to cell. An explicit `role="cell"` leaves all of this unchanged and adds an attribute to every cell in the table.

In most tables you'll see an error next to this warning. When the `<table>` has no `role` attribute, or has `role="table"`, `role="grid"` or `role="treegrid"`, its `<td>` cells can't have a `role` attribute at all. Removing `role="cell"` fixes both messages.

The attribute usually comes from table plugins or from markup copied out of online word processors, which put a role on every row and cell. The `cell` role exists for tables built from generic elements such as `<div>`, where nothing in the HTML marks an element as a cell. A native `<td>` doesn't need it, so delete the attribute. If the same table has roles on its rows or header cells, remove those as well.

## Invalid example

```html
<table>
  <thead>
    <tr>
      <th>Region</th>
      <th>Delivery time</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td role="cell">Europe</td>
      <td role="cell">3 to 5 days</td>
    </tr>
    <tr>
      <td role="cell">North America</td>
      <td role="cell">5 to 7 days</td>
    </tr>
  </tbody>
</table>
```

## Valid example

```html
<table>
  <thead>
    <tr>
      <th>Region</th>
      <th>Delivery time</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Europe</td>
      <td>3 to 5 days</td>
    </tr>
    <tr>
      <td>North America</td>
      <td>5 to 7 days</td>
    </tr>
  </tbody>
</table>
```
