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 Stuck here creating a table heading , someone plz guide thanks

Can someone guide me with these table heading im not getting it .

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

    <!-- Write your code below -->

    <table>
      <tr>
     <th></th>
      </tr> 
    </table>


  </body>
</html>

1 Answer

Jacobus Hindson
Jacobus Hindson
14,429 Points

Hi Hassam,

The th tag is the heading you find at the top of a column, see my example.

<!DOCTYPE html>
<table>
  <tr>
  <th>Heading 1</th>
  <th>Heading 2</th>
  <th>Heading 3</th>
  </tr>
  <tr>
    <td>Result 1</td>
    <td>Result 2</td>
    <td>Result 3</td>
  </tr>
</table> 

Will result in a table that looks like:

th elements -> Heading 1 Heading 2 Heading 3

td elements -> Result 1 Result 2 Result 3