Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Tables HTML Tables

Hey Guys Im adding a table header tag to my challenge and its returning error.

Hey Guys Im adding a table header tag to my challenge and its returning error. Please could you check to see if my code is correct? Im sure it is? Thanks

<table> <th></th> <td>Fruit</td> <td>Vegetables</td>

</table>

index.html
<!DOCTYPE html>
<html>
  <head>
    <title>HTML Tables Challenge</title>
  </head>
  <body>
    <h1>HTML Tables Challenge</h1>

    <table>
      <th></th>
      <td>Fruit</td>
      <td>Vegetables</td>

    </table>


  </body>
</html>

2 Answers

Hey Gary Buckingham, instead of the th element, try thead (table header) element. The th (table heading cell) should be nested within tr (table row). Which should also be nested inside the thead element.

<table>

  <thead>
    <tr>
      <th>Heading</th>
    </tr>
  </thead>

</table>

All done!! Thanks alot guys I managed to work it out myself! Loving this course "you guys ROCK" \m/