Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

Having trouble with a code challenge

Having trouble with the table code challenge that says, "Put two header cells with any text inside of the row you just created." Not sure what it means. This is the code I have so far:

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

<!-- Write your code below -->

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

</body> </html>

7 Answers

k robinson
k robinson
3,684 Points

looks like u were missing a / in the closing table

Joe Bissell
Joe Bissell
13,107 Points

I'm pretty tired but I'm guessing it means this...

<table>
   <tr> 
         <th> A table head </th>       
         <th> Another table head </th>  
   </tr>
   <tr>
         <td> Normal table data </td>
         <td> Normal table data </td>
    </tr>
</table>

aaaaannnddd it would seem the code markdown didn't work facepalm. Never used them before and about to go sleep, sorry bout that :)

Justin Horner
STAFF
Justin Horner
Treehouse Guest Teacher

Hello Jason,

I believe the solution Joe provided is what you're looking for. To create header cells you need to use the <th> element inside a row. Check this out as a reference.

I hope this helps.

I can't figure out how to copy my code here. I made the changes you guys suggested and I feel like my answer is right but it is still failing me. Kinda hard to have a discussion about it without pasting code here.

Still having trouble. Here is what I have so far... http://i.imgur.com/s6kBQr7.png

I'm sure you already got past this part, but I had the same problem and finally figured it out. What they're asking is for you to add another header next to the one you've already created; that is, add a second header to the right/in the next cell. Why they worded it the way they did is beyond me.

Switch your thead tags to th tags and your code should work. I think thead is only supposed to be used so browsers can recognize it or whatever.

I am struggling with it too please help: put two header cells with any text inside of the row you just ceated.

       <thead>
          <tr>
          <th>fruits</th>
         </tr>
         <tr>
           <th>vegetables</th>
           <th>wrong answer</th>
           <th>wrong too</th>
        </thead>
       </table>```
I tried different things but I am still stuck.