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

Hmmm.. don't see the problem. Isn't inside the table?

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

<table border="1">
  <tr>
      <th>Flowers</th>
      <th>Herbs</th>
    </tr>


   <tr>
      <td>Roses</td>
      <td>Thyme</td>
    </tr>
    <tr>
      <td>Tulips</td>
      <td>Rosemary</td>
    </tr>
    <tr>
      <td>Daisys</td>
      <td>Lavender</td>
    </tr>
   </table>    <!-- Write your code below -->


  </body>
</html>

5 Answers

Erik McClintock
Erik McClintock
45,783 Points
  Paula,

Your table is not formatted per the specifications outlined in the code challenge. Tables can be a bit tricky, but if you follow along slowly and step-by-step, as in this challenge, you will start to grasp the way that they're built.

It asks for you to first create a table tag:

<table>
</table>

...then to add a table header tag...

<table>
    <thead>
    </thead>
</table>

...then to add a row inside of the table header you just created...

<table>
    <thead>
        <tr>
        </tr>
    </thead>
</table>

...then to add two header cells into the row you just created, filling those cells with any data you like...

<table>
    <thead>
        <tr>
            <th>Flowers</th>
            <th>Herbs</th>
        </tr>
    </thead>
</table>

...then to add a table body tag...

<table>
    <thead>
        <tr>
            <th>Flowers</th>
            <th>Herbs</th>
        </tr>
    </thead>
    <tbody>
    </tbody>
</table>

...then to add a row to the body...

<table>
    <thead>
        <tr>
            <th>Flowers</th>
            <th>Herbs</th>
        </tr>
    </thead>
    <tbody>
        <tr>
        </tr>
    </tbody>
</table>

...then to add cells with text to the row inside the body...

<table>
    <thead>
        <tr>
            <th>Flowers</th>
            <th>Herbs</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Roses</td>
            <td>Thyme</td>
        </tr>
    </tbody>
</table>

..and finally, add another table row that has one cell inside, which needs to span two columns...

<table>
    <thead>
        <tr>
            <th>Flowers</th>
            <th>Herbs</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Roses</td>
            <td>Thyme</td>
        </tr>
        <tr>
            <td colspan="2">Any text you want</td>
        </tr>
    </tbody>
</table>

The code shown here will pass the challenge, though I encourage you to go back and rewatch the video(s) leading up to the challenge in order to get a better understanding of these tags and how tables are constructed. You could simply copy and paste and move on, but that won't help you learn!

Hope this helps!

Erik

Julian Ptak
Julian Ptak
30,920 Points

What exactly is the error you are getting and what are you trying to do? Could you please post the question too? It'd make it easier for us to help you! :)

Hello Julian, It says Bummer .. place the header inside the table? but as far as I can see it is inside the table? Thanks for your help. Paula

Hello Julian, Yes the task was to add the table header and it looks fine in the preview but I keep getting the Bummer message that it should be inside the table? Thanks. Paula