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

Allan Alivio
Allan Alivio
2,695 Points

Add cells with text to your table body. Stuck on the coding

Im stuck on HTML tables quiz Question 7 "Add cells with text to your table body.". Am I missing something? Did i miss a bracket or something?

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

    <!-- Write your code below -->
            <table>
        <tr>
          <thead>
            <tr>
              <th>table data 1</th>
              <th>table data 2</th>
            </tr>
          </thead>
        </tr>  
            <tbody>
               <tr>
                <td>text 1 </td>
                         <td>text 2</td>
                   </tr>
            </tbody>
        </table>

  </body>
</html>

2 Answers

Maybe this is messing you up (on your code): - Try to take out the opening TR on your code under table and it should work. (The full code at the bottom is mine and working)

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

    <!-- Write your code below -->
    <table>
      <thead>
        <tr>
          <th>text</th>
          <th>text</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>text</td>
          <td>text</td>
        </tr>      
      </tbody>
    </table>


  </body>
</html>
Allan Alivio
Allan Alivio
2,695 Points

Awesome thanks so much

James Barnett
James Barnett
39,199 Points

Allan Alivio - As Andrew Gale alluded table rows (<tr>) when using <thead> any <tr>s must be inside of it.