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

I'm having problems adding a cells with data using the <td> rather than <th>. what's wrong?

Please review my addcells1 addcells2 . I am using the td vs. th. What am I doing wrong?

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>Month</th>
         <th>Savings</th>
       </tr>
      </thead>
     <tbody>
       <tr>
         <th>January</th>
         <th>$100</th>
       </tr>
       <tr>
         <th>February</th>
         <th>$50</th>
       </tr>
       <tr>
         <th>March</th>
         <th>$30</th>     
       </tr>
        <tr>
         <td>Addcells1</td>
         <td>Addcells2</td>
        </tr>
     </tbody>
      <tr>
         <th>April</th>
         <th>$25</th>
      </tr> 
    </table>  
  </body>
</html>

1 Answer

Rich Zimmerman
Rich Zimmerman
24,063 Points

I'm guessing you're concerned that the text is not bold? <th> by default is bold because it is supposed to be the head of a column or row - meaning the label of the data that will be provided in the corresponding cells. <td> elements would be those corresponding cells.

So "Month" and "Savings" would be your heads, and the rest would be your actual data.