# The “name” attribute is never allowed on the “td” element.

> Canonical HTML version: https://rocketvalidator.com/html-validation/the-name-attribute-is-never-allowed-on-the-td-element
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The `name` attribute is not a valid attribute for the `<td>` element in HTML.

The `name` attribute was never part of any HTML specification for table cells. Some older browsers tolerated it as a way to create anchor targets within a table, but validators reject it because it does not belong on `<td>`. If the goal is to create a link target so users can jump to a specific cell, use the `id` attribute instead. The `id` attribute is a global attribute, valid on any HTML element, and works as a fragment identifier in URLs (e.g., `page.html#cell1`).

If the `name` attribute was being used for JavaScript access, switch to `id` and use `document.getElementById()`, or use a `data-*` attribute for storing custom metadata.

## Invalid example

```html
<table>
  <tr>
    <td name="cell1">Data</td>
  </tr>
</table>
```

## Valid example

Using `id` as a fragment target:

```html
<table>
  <tr>
    <td id="cell1">Data</td>
  </tr>
</table>
```

If custom metadata is needed rather than a link target, a `data-*` attribute works:

```html
<table>
  <tr>
    <td data-name="cell1">Data</td>
  </tr>
</table>
```
