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.

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,062 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.