# The “role” attribute must not be used on a “tr” element which has a “table” ancestor with no “role” attribute, or with a “role” attribute whose value is “table”, “grid”, or “treegrid”.

> Canonical HTML version: https://rocketvalidator.com/html-validation/the-role-attribute-must-not-be-used-on-a-tr-element-which-has-a-table-ancestor-with-no-role-attribute-or-with-a-role-attribute-whose-value-is-table-grid-or-treegrid
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

A `<tr>` element already has an implicit ARIA role of `row`, so adding `role="row"` is redundant when the parent `<table>` uses its default semantics or has a `role` of `table`, `grid`, or `treegrid`.

HTML tables come with built-in accessibility semantics. The `<table>` element implicitly has `role="table"`, and `<tr>` implicitly has `role="row"`. Browsers and assistive technologies already understand this structure, so explicitly adding these roles is unnecessary and flagged by the W3C validator.

The only time you'd need to add a `role` to a `<tr>` is when the table's native semantics have been overridden — for example, if the `<table>` has been repurposed with a non-table role like `role="presentation"` or `role="none"`. In that case, you'd need explicit ARIA roles to restore row semantics.

## Incorrect Example

```html
<table>
  <tr role="row">
    <th>Name</th>
    <th>Email</th>
  </tr>
  <tr role="row">
    <td>Alice</td>
    <td>alice@example.com</td>
  </tr>
</table>
```

## Fixed Example

Simply remove the redundant `role="row"` from the `<tr>` elements:

```html
<table>
  <tr>
    <th>Name</th>
    <th>Email</th>
  </tr>
  <tr>
    <td>Alice</td>
    <td>alice@example.com</td>
  </tr>
</table>
```

The same fix applies if your `<table>` explicitly has `role="table"`, `role="grid"`, or `role="treegrid"` — the `<tr>` elements still don't need an explicit `role="row"` because the browser infers it automatically.
