<td> and </td>

PURPOSE: To enter the data for a table. Data may be horizontally aligned left,right or center. The default is left alignment. It may also be vertically aligned (valign) top, bottom or middle. The default valign is middle. Other attributes you can use are: width, nowrap, colspan, and rowspan.
If you put nowrap in your table cell, like so: <td nowrap>,the text in that cell will not wrap, unless you manually break it with the <br> tag.

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

An example of horizontal and vertical alignments.

<table border="1" width="100%" summary="test table">
<tr>
<td align="left"> First </td><td align="center"> Second </td><td align="right"> Third </td>
</tr>
<tr>
<td align="left" valign="top"><br><br> Fourth </td><td align="center" valign="middle"> Fifth </td><td align="right" valign="bottom"> Sixth </td>
</tr>
</table>

FirstSecondThird
Fourth

FifthSixth

Another Example of all the different alignments:

Table Cell
 Alignments
valign="middle" valign="top" valign="bottom"
align="center" TEXT TEXT TEXT
align="left" TEXT TEXT TEXT
align="right" TEXT TEXT TEXT

© Copyright 2001,2002 Southern Twilight    All rights reserved.

Back To HTML Examples