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

The code challenge is displaying what appears to be an unwanted error message {SOLVED}

I have followed the code example exactly from the video and the review page and the code all look correct but there is an error message "Bummer! One table cell needs to span two columns" {SOLVED} SO

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

    <!-- Write your code below -->

    <table border="1">
    <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>
       <tbody>
      <tr>
        <td>Oranges</td>
        <td>Carrots</td>
      </tr>
      <tr>
        <td>Apples</td>
        <td>Broccoli</td>
      </tr>
      <tr>
        <td>Strawberries</td>
        <td>Asparagus</td>
      </tr>
      <tr>
        <td></td>
        <td>Potatoes</td>
      </tr>
    </tbody>
  </table>


  </body>
</html>

THANKS EVERYONE I FOUND THE PROBLEM!!

the problem was that the tfoot was causing the problem thanks guys :)

2 Answers

Luciano Bruzzoni
Luciano Bruzzoni
15,518 Points

You need to use the colspan keyword in one of your cell elements to make it extend into two columns.

<td colspan="2">This extends two columns</td>

THANKS Luciano I really appreciate that you helped me you gave me an idea to remove the tfoot THANKS

Luciano Bruzzoni
Luciano Bruzzoni
15,518 Points

Glad it helped. Some of these challenges are so picky sometimes lol.

lol

Kevin Lee
Kevin Lee
2,898 Points

I think you need to put the new row inside tbody and /tbady.

Thanks but i found a way by myself (i removed the tfoot) :)