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 Headers and Footers

Katherine Liu
Katherine Liu
4,668 Points

Add cells with text to your table body.

Hi, so I can't pass this challenge task. It asks me to add cells with text to my table body.

In the video lesson, I don't think he puts tbody elements in his examples, so I took them out. But it doesn't work either. Here are the possibilities that I tried

1) Submitted without tfoot but with tbody 2) Submitted with tfoot but without tbody 3) Submitted without tfoot but with tbody 4) Submitted without tfoot and without tbody

but none of the options above work. I must be doing something wrong or else I'd be passing. I believe I am making a cell within the body and adding text to it.

This is my code. Note: The opening table tag seems to disappear below. Thanks in advance

    <thead>
      <tr>
        <th>a</th>
        <th>b</th>
      </tr>
    </thead>
    <tbody> 
      <tr>
          <th>text</th>
      </tr>
    </tbody>
  </table>```

1 Answer

Stone Preston
Stone Preston
42,016 Points

try using table data tags <td> instead of table header tags. It also asks for cells, so try adding more than one table data tag

<table>
    <thead>
      <tr>
        <th>a</th>
        <th>b</th>
      </tr>
    </thead>
    <tbody> 
      <tr>
          <td>text</td>
          <td>text</td>
      </tr>
    </tbody>
  </table>