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: "Put two header cells with any text inside of the row you just created."

Please help! I'm stuck on this quiz question! No matter what I try I'm wrong. Here's what 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 border="1">
  <thead> 
    <tr>
      <th colspan="2">Heading</th>
    </tr>

    <tr>
      <th colspan="2">Rown inside table header</th>      LAST ROW CREATED
    </tr>
<tr>
      <th>Fruits</th>
      <th>Veggies</th>
    </tr>
  </thead> 

  <tr>
    <td>Apples</td>
    <td>Broccoli</td>
  </tr>
  <tr>
    <td>Oranges</td>
    <td>Cucumbers</td>
  </tr>

</table>

</body> </html>

What is the correct answer? Thanks in advance. =]

5 Answers

You only need to create a single row in the table heading and add two header inside that row.

<thead>
   <tr>
       <th>Example 1</th>
       <th>Example 2</th>
   </tr>
</thead>

The challenge is to create a single row in the table header <thead></thead>, the result of the html code you posted and also with barbara allen is three rows in the header which is why the system tells you that you are wrong. Outside of the code challenge there is nothing wrong with the html code that you posted, Its the correct markup for a table.

If you post a code here in the discussion indent you sentence with 4 spaces or a single tab and it will turn it to code block. You can click the "Markdown Cheatsheet".

Hi Dexter! Thanks for your reply. Your answer is exactly what I put. The system told me I was wrong. I then began to second guess myself and tried doing all sorts of other things, which were also incorrect. Do you know how I can bypass the question and keep going?

Try this one...

<table border="1">
          <thead>
                 <tr>
                      <th>Fruits</th>
                      <th>Veggies</th>
                 </tr>
           </thead>
           <tbody>
                  <tr>
                       <td>Apples</td>
                       <td>Broccoli</td>
                  </tr>
                   <tr>
                        <td>Oranges</td>
                        <td>Cucumbers</td>
                   </tr>
         </tbody>  
</table>

That is the correct answer Dexter, but can you tell me why that is the answer, when the user "Barbara Allen" did what I thought was right, which is:

<!DOCTYPE html> HTML Tables Challenge HTML Tables Challenge

<!-- Write your code below -->

<table border="1">
  <thead> 
    <tr>
      <th colspan="2">Heading</th>
    </tr>

    <tr>
      <th colspan="2">Rown inside table header</th>      LAST ROW CREATED
    </tr>
<tr>
      <th>Fruits</th>
      <th>Veggies</th>
    </tr>
  </thead> 

  <tr>
    <td>Apples</td>
    <td>Broccoli</td>
  </tr>
  <tr>
    <td>Oranges</td>
    <td>Cucumbers</td>
  </tr>

</table>

And for some reason that is the wrong answer your answer Dexter is right. Why? Please I need to know the answer so that I understand full in details.

Thank You

P.S. Sorry I don't know how to copy and paste it here as HTML (you can explain that to me too)