Version: 3.2, 4.0
Compability: Explorer 4, 5 Netscape 4, 6
The <tr> tag is used to create a row in a table element. You can create as many rows as you wish.
This row can contain one or more cells where each cell can contain data, information, or text that you wish to display in the table. These cells are created by using either the td or th tags.
The closing tag is optional. However, it is recommended that it always be included. Also, tr tags should never appear inside of th, td, or other tr tags.
The coding sequence is:
<tr><th> place header here </th></tr>
And:
<tr><td> place data here </td></tr>
<table width="80%" border="10" cellpadding="3" cellspacing="5" align="center">
<caption>
<center><b>How To Code A Table</b></center>
<br>
Use the caption tag to name the table and to provide useful information about the contents
</caption>
<tr>
<th colspan="2">Use the <b>th</b> tag to create the header which will display in bold</th>
</tr>
<tr>
<td width="50%">The <b>tr</b> tag creates the row</td>
<td width="50%">The <b>td</b> tag creates individual cells for each row</td>
</tr>
<tr>
<td width="50%">You should always use closing tags</td>
<td width="50%">You can use a variety of HTML tags inside the cell</td>
</tr>
<tr>
<td width="50%">The three new version 4.0 table tags are <b>tbody, tfoot,</b> and <b>thead</b></td>
<td width="50%">The <b>colspan</b> attribute allows you span more than one cell</td>
</tr>
</table>
How To Code A Table
Use the caption tag to name the table and to provide useful information about the contentsUse the th tag to create the header which will display in bold The tr tag creates the row The td tag creates individual cells for each row You should always use the closing tags You can use a variety of HTML tags inside the cell The three new version 4.0 table tags are tbody, tfoot, and thead Setting colspan allows you span more than one cell
This example demonstrates the basic table tags.