# The “row” role is unnecessary for element “tr”.

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

A `<tr>` element already has the ARIA role `row`, so adding `role="row"` to it repeats what browsers and screen readers already know.

HTML gives each element a default ARIA role. A `<tr>` inside a `<table>` is exposed to assistive technology as a row with no extra markup, and the cells inside it get their roles the same way. Writing `role="row"` by hand changes nothing for users and makes the markup harder to read.

The same attribute also triggers an error. When the `<table>` has no `role` attribute, or has `role="table"`, `role="grid"` or `role="treegrid"`, its `<tr>` elements can't have a `role` attribute at all. Removing `role="row"` fixes both messages.

This often shows up in tables pasted from online word processors, which add `role="row"` to every row. The `row` role is meant for tables built from generic elements such as `<div>`, where nothing else tells a screen reader which elements form a row. A native `<tr>` doesn't need it.

## Invalid example

```html
<table>
  <tr role="row">
    <th>Product</th>
    <th>Price</th>
  </tr>
  <tr role="row">
    <td>Notebook</td>
    <td>$4.50</td>
  </tr>
</table>
```

## Valid example

```html
<table>
  <tr>
    <th>Product</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>Notebook</td>
    <td>$4.50</td>
  </tr>
</table>
```
