'Validation: "th start tag in table body."

<table>
<thead>
 <th>Table Heading</th>
</thead>
<tbody>
 <tr>.....
</tbody>
</table>

When I try to validate this part of code, the validator returns this error:

 th start tag in table body.

The table template was copied from getbootstrap.com so I should assume it's valid. What's the problem here? Why is the validator returning this error, and how can I solve it?



Solution 1:[1]

The placement of your <th> element is correct aside from it needing to be placed inside a <tr> tag as well... as D Stanley mentioned.

This is the full HTML table formatting specified by W3C:

<table>
 <thead>
  <tr>
     <th>Month</th>
     <th>Savings</th>
  </tr>
 </thead>
 <tfoot>
  <tr>
     <td>Sum</td>
     <td>$180</td>
  </tr>
 </tfoot>
 <tbody>
  <tr>
     <td>January</td>
     <td>$100</td>
  </tr>
  <tr>
     <td>February</td>
     <td>$80</td>
  </tr>
 </tbody>
</table>

W3C

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Umbrella