HTML Tutorials

Adding Headers Cells

The th element denotes a header cell, allowing us to differentiate between data and the descriptions of that data. You can see how we added th elements to the table to provide some context for the data values contained in the td elements.

        <th>2nd Favorite:</th>
        <th>3rd Favorite:</th>
        <td>A kind of greeny-red</td>
        <td>Varies from medium to large</td>
2nd Favorite:OrangesOrangeLarge
3rd Favorite:PomegranateA kind of greeny-redVaries from medium to large

You can see that we are able to mix the th and td elements together in a row and also create a row that just contains th elements.