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

Problems with Code Challenge:"Create another table row with a cell that spans two columns."

<table border="5">
    <thead>
<tr>


    <th>These are<br> my favorite FRUITS</th>
    <th valign="middle">VEGETABLES</th>

 </tr>
</thead>
<tfoot>
    <tr>
        <td colspan="2" align="center">Thanks for reading!</td>

        </tr>

</tfoot>
 <tr>
     <td>Oranges</td>
     <td>Carrots</td>


 </tr>
 <tr>
        <td>Apples</td>
        <td>Brocolli</td>


  </tr>
  <tr>

        <td>Strawberries</td>
        <td>Asparagus</td>

  </tr>
  <tr>

        <td></td>
        <td>Potatoes</td>
</tr>
</table>
</body>


</html>   ```

7 Answers

<tr>
     <td colspan="2" align="center">Fruit is so healthy!</td>
</tr>

Hi Kimberly,

To add another row spanning 2 columns in this table, you should simply add another TableRow in which you will have a TD, with a specified colspan:

<tr>
     <td colspan="2" align="center">Text goes here</td>
</tr>

You can add this in your thead, tfoot and main table... I hope this helps. Nico

apply colspan="2" to td inside tr

? Not understanding

how do you write code inside comment?

Weird your first answer asked me Sum=$180...and now it shows up as apply colspan="2"to td inside tr.

I tried that too and still doesn't work. I'll need to double check everything again. Thanks for the support!

Gregory Serfaty
Gregory Serfaty
37,140 Points

You put your colspan in the tfoot but you must to put in tbody like this

<tr>
        <td colspan="2">Potatoes</td>
</tr>
</table>

I put a new colspan in tfoot and put body like<tr> <td colspan="2">Potatoes</td></tr>

My table is at bottom of page and i nestled in original table since it is one table I am working with...Still not working

I tried that, but still doesn't work, states one table row needs to span 2 columns

```<table border="5"> <thead> <tr>

<th>These are<br> my favorite FRUITS</th>
<th valign="middle">VEGETABLES</th>

</tr> </thead> <tfoot> <tr> <td colspan="2" align="center">Thanks for reading!</td>

    </tr>

<tr>

<td colspan="2" align="center">Fruit is so healthy!</td>

</tr>

</tfoot> <tr> <td>Oranges</td> <td>Carrots</td>

</tr> <tr> <td>Apples </td> <td>Brocolli</td>

</tr> <tr>

    <td>Strawberries</td>
    <td>Asparagus</td>

</tr> <tr>

    <td></td>
    <td>Potatoes</td>

</tr> </table> </body>```

Hi Everyone, thanks for all your comments. Finally see what I was doing wrong. They wanted me to extend one of list items ( not the footer into the next column. I kept putting my colspan in footer. So I put it at the begging of list first item like this

     <td colspan="2">Oranges</td>
     <td>Carrots</td>
</tr>```
this seemed to work

<!DOCTYPE html> <html> <head> <title>HTML Tables Challenge</title> </head> <body> <table border="10" cellpadding="10" cellspacing="10"> <thead> <tr> <th> These Are<br> my favorite Fruits</th> <th>Vegetables</th> </tr> </thead> <tfoot> <tr> <td colspan="2" align="center"> Thanks for reading</td>

  </tr>

</tfoot>
<tr>
  <td>Oranges</td>
  <td>Oranges</td>
</tr>

 <tr>
  <td>Apples</td>
   <td>Oranges</td>
</tr>

 <tr>
  <td>Strawberries</td>
   <td>Oranges</td>
</tr>

<tr> <td colspan="2" align="center">Arybrown@treehouse.com</td> </tr>

</table> <h1>HTML Tables Challenge</h1>

   <tr>
    <th>
        <h3>TEST</h3>
     </th>
<!-- Write your code below -->

</body> </html>