<tr> and </tr>

PURPOSE: To make a table row. Rows may be horizontally aligned left,right or center. The default is left alignment.

Below is a basic html document. The referenced html tag is in RED. All tags must have a start and a end tag. Most end tags have a / before the tags name, however there are a few that are done differently. The tags that end differently will be noted and highlighted. The order of the start and end tags is also very important to proper display of your page in a web browser.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title> The Page Title Goes Here </title>
</head>
<body>
<table border="1" width="100%" cellspacing="0" cellpadding="0" summary="test table">
<tr>
<td> First </td>
<td> Second </td>
</tr>
<tr>
<td> Third </td>
<td> Fourth </td>
</tr>
</table>
</body>
</html>


The above code produces the following table:

FirstSecond
ThirdFourth

Examples of table row alignments:

<table border="1" width="100%" cellspacing="0" cellpadding="0" summary="test table">
<tr align="right"><td> First </td><td> Second </td></tr>
<tr align="center"><td> Third </td><td> Fourth </td></tr>
<tr align="left"><td> Fifth </td><td> Sixth </td></tr>
</table>

FirstSecond
ThirdFourth
FifthSixth

<table border="1" width="100%" cellspacing="0" cellpadding="0" summary="test table">
<tr valign="top"><td> First </td><td> Second </td></tr>
<tr valign="middle"><td> Third </td><td> Fourth </td></tr>
<tr valign="bottom"><td> Fifth </td><td> Sixth </td></tr>
</table>

FirstSecond
ThirdFourth
FifthSixth

© Copyright 2001,2002 Southern Twilight    All rights reserved.

Back To HTML Examples