- The <TR> tag allows you to apply a subset of the attributes
that you can apply to table cells to entire table rows.
- The attributes are defined in the following table.
| ATTRIBUTE |
DESCRIPTION |
| ALIGN |
Specifies the alignment of the text within the cells in the row.
Valid values can be LEFT, RIGHT, or CENTER |
| BGCOLOR |
Specifies the background color for the table cells in the row. It
works just the same as the corresponding attribute for the <BODY>
tag |
| VALIGN |
Specifies the vertical alignment of text within the cells in the
row. Valid values are TOP, BOTTOM, or CENTER. |
Table Row Attributes by Example
- The usage of the attributes is best shown by example, so here are
several examples showing what can be done with table cell attributes:
- Here is a table with different colored cells.
| Center aligned header |
Center aligned header |
This row is right-aligned horizontally and bottom-aligned
vertically |
The whole row is yellow |
This row is centered horizontally and top-aligned
vertically |
The whole row is orange |
- Here is the code for that table:
<TABLE BORDER = "1">
<TR ALIGN = "CENTER">
<TH>Center aligned header</TH>
<TH>Center aligned header</TH>
</TR>
<TR BGCOLOR = "YELLOW" VALIGN = "BOTTOM" ALIGN = "RIGHT">
<TD>This row is right-aligned
horizontally and bottom-aligned
<BR> vertically</TD>
<TD>The whole row is yellow</TD>
</TR>
<TR BGCOLOR = "ORANGE" VALIGN = "TOP" ALIGN = "CENTER">
<TD>This row is centered horizontally and
top-aligned
<BR>vertically</TD>
<TD>The whole row is orange</TD>
</TR>
</TABLE>
Previous Page |
Next Page
|