Skip to main content
HTML Validation

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

About This HTML Issue

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

The name attribute was never part of any HTML specification for tables. Some older browsers tolerated it as a way to create anchor targets, but validators reject it because it does not belong on <table>. If the goal is to link directly to a table, 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#prices).

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

<table name="prices">
  <tr>
    <td>Item</td>
    <td>Price</td>
  </tr>
</table>

Valid example

Using id as a fragment target:

<table id="prices">
  <tr>
    <td>Item</td>
    <td>Price</td>
  </tr>
</table>

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

<table data-name="prices">
  <tr>
    <td>Item</td>
    <td>Price</td>
  </tr>
</table>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
$7 / 7 days

Pro Trial

Full Pro access. Cancel anytime.

Start Pro Trial →

Join teams across 40+ countries