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
|