Search DaTutorials:  
HOME
Html Tutorials
Basics
Forms
Frames
Hyperlinks and URLS
Images
Lists
Background
Colors
Fonts
Tables
Meta Tags
Events
Javascript Integration
Sound
Other
Search For a Tutorial
Html Reference

Headings in a table

Description:


How to create headings in a table.

Code:

<html>
<body>


<h4>Horizontal headers</h4>
<table border="1">
<tr>
  <th>Name</th>
  <th>GSM</th>
  <th>Adress</th>
  <th>e-mail</th>
</tr>
<tr>
  <td>P. Ivanov</td>
  <td>0889 99 99 99</td>
  <td>London</td>
  <td>ivanov@hotmail.com</td>
</tr>
</table>


<h4>Vertical headers</h4>
<table border="1">
<tr>
  <th>Name</th>
  <td>P. Ivanov</td>
</tr>
<tr>
  <th>GSM</th>
  <td>0889 99 99 99</td>
</tr>
<tr>
  <th>Adress</th>
  <td>London</td>
</tr>
<tr>
  <th>e-mail</th>
  <td>ivanov@hotmail.com</td>
</tr>
</table>


</body>
</html>

Play with the code:

See working example:


Explanation:

To create a headers for the table's columns, use the <th></th> tag instead the <td></td> tag in the first row of the table.

See Also:

HTML: Html, Body, Table, Tr, Td, Th


Online Html Forum  Discuss this tutorial in our HTML forum


     Personal Loans | Mortgage | Pay Day Loans | Debt Help | Car Insurance
Home     Link To Us     Ad With Us     Contact Us     Tell A Friend     Affiliates     Blog     MsOfficeHelp