Skip to main content
HTML Validation

The element “h3” must not appear as a descendant of the “th” element.

About This HTML Issue

To fix the W3C HTML Validator issue stating that a heading element like h1, h2, h3, h4, h5 or h6 must not appear as a descendant of the th element, you need to ensure that the HTML structure follows the specifications where a heading element (h1 to h6) is not placed within a table cell element like th.

Here’s an example of what might be causing the issue and how you can correct it:

Incorrect HTML:

<table>
  <tr>
    <th>Month</th>
<!-- Incorrect placement of h3 inside th -->

  </tr>
  <tr>
    <td>January</td>
    <td>$500</td>
  </tr>
</table>

Corrected HTML:

<h4>Revenue per month</h4>
<table>
  <tr>
    <th>Month</th>
    <th>Revenue</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$500</td>
  </tr>
</table>

In the corrected example, the issue is fixed by removing the h3 element from the th element. If you need to style the text inside the th element differently, you can achieve that via CSS without nesting heading elements inside table cell elements.

Last reviewed: April 12, 2024

Was this guide helpful?

Find issues like this automatically

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

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