Webmaster in a Nutshell

Previous Chapter 5

5.3 The <tr> Tag

Every row in a table is created with a <tr> tag. Within the <tr> tag are one or more cells containing either headers, each defined with the <th> tag, or data, each defined with the <td> tag.

Every row in a table has the same number of cells as the longest row; the browser automatically creates empty cells to pad rows with fewer defined cells.

Attributes to the <tr> tag are used to control behavior for every cell it contains. There are two commonly used attributes for this tag.

align is used differently in <tr> than it is in <table>. In a table row, align lets you change the default horizontal alignment of the contents of the cells within the row. The attribute accepts values of left, right, or center. For Internet Explorer and Netscape, the default horizontal alignment for header cells (<th>) is centered, and for data cells (<td>) it is left-justified.

The valign attribute allows you to specify the vertical alignment of cell contents within a row. Internet Explorer and Netscape support three values: top, center, and bottom. The default vertical alignment for both browsers is centered.

Netscape also supports a value of baseline for valign. This value specially aligns cell contents to the baseline of the top line of text in other cells in the row.

The remaining attributes for the <tr> tag are specific to Internet Explorer. They are discussed at the end of this chapter.

Previous Home Next
The <caption> Tag Book Index The <th> and <td> Tags

HTML: The Definitive Guide CGI Programming JavaScript: The Definitive Guide Programming Perl WebMaster in a Nutshell
Hosted by uCoz