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

Cassandra James
Cassandra James
7,561 Points

HTML Tables Code Challenge 8 of 8

Here is my code. <!-- Write your code below --> <table> <thead> <tr> <th>Fruits</th> <th>Vegetables</th> </tr> </thead>

  <tbody>
    <td>Kiwi</td>
    <td>Mustard Greens</td>

 </table>

</body> </html>

Challenge: I need to create another table row with a cell that spans two columns.

Does the code go In between the thead tags? YES or NO This is the code I tried <tr colspan="2"> </tr>

I am thinking it is the way this is worded that I am not getting.

Thanks.

Hi,

There are a couple of things to consider.

<table>
    <thead></thead>
    <tfoot></tfoot>
    <tbody>
    <tr>
        <td> ... </td>
        <td> ... </td>
    </tr>
    </tbody>
</table>

In the above example, the table has 1 table row, with 2 table data tags.

If you wanted to add one row that spanned both columns you could insert:

<tr>
    <td colspan="2"> ... </td>
</tr>

before the closing </tbody> tag.

The code would not go in the <thead></thead> tags, though.

You may want to do similar things in thead and tfoot tags, however.

1 Answer

Cassandra James
Cassandra James
7,561 Points

I got it. Thanks for your help. I found the wording to be confusing for some reason but here is what I did: In <tbody> I added: <tr> <td colspan="2"></td> </tr>