Skip to main content
HTML Validation

Start tag “a” seen in “table”.

About This HTML Issue

The HTML <table> element follows a rigid structure. A <table> can only contain <caption>, <colgroup>, <thead>, <tbody>, <tfoot>, and <tr> as direct children. A <tr> can only contain <td> and <th> elements. Placing an <a> tag (or any other inline/flow content) directly inside <table>, <tr>, or other table-structural elements violates this content model, triggering the “Start tag a seen in table“ validation error.

This matters for several reasons. Browsers handle invalid table markup inconsistently — some may silently move the misplaced <a> element outside the table entirely, while others may render it in unexpected positions. This leads to unpredictable layouts and broken links. Screen readers and other assistive technologies rely on proper table structure to navigate content, so misplaced elements can make the page confusing or inaccessible. Additionally, search engine crawlers may not correctly associate the link with its intended context.

The fix is straightforward: always wrap inline content like <a> inside a <td> or <th> element. Every piece of visible content in a table must live inside a table cell.

Examples

❌ Incorrect: <a> directly inside <tr>

<table>
  <tr>
    <a href="/details">View details</a>
  </tr>
</table>

The <a> is a direct child of <tr>, which only allows <td> and <th> children.

❌ Incorrect: <a> directly inside <table>

<table>
  <a href="/details">View details</a>
  <tr>
    <td>Data</td>
  </tr>
</table>

The <a> is a direct child of <table>, which does not allow inline content.

❌ Incorrect: <a> directly inside <tbody>

<table>
  <tbody>
    <a href="/details">View details</a>
    <tr>
      <td>Data</td>
    </tr>
  </tbody>
</table>

The <a> is placed directly inside <tbody>, which only allows <tr> and <script>/<template> elements.

✅ Correct: <a> inside a <td>

<table>
  <tr>
    <td>
      <a href="/details">View details</a>
    </td>
  </tr>
</table>

✅ Correct: <a> inside a <th>

<table>
  <thead>
    <tr>
      <th>
        <a href="/details">View details</a>
      </th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Data</td>
    </tr>
  </tbody>
</table>

✅ Correct: wrapping an entire row’s content in a link

If you want to make an entire row clickable, place the <a> inside each <td> rather than wrapping the <tr>:

<table>
  <tr>
    <td><a href="/item/1">Product name</a></td>
    <td><a href="/item/1">$19.99</a></td>
    <td><a href="/item/1">In stock</a></td>
  </tr>
</table>

This keeps the table structure valid while still providing clickable content across the row. You can use CSS to remove the visual link styling and make each <a> fill its entire cell for a seamless clickable-row effect.

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?

Ready to validate your sites?
Start your free trial today.