Login for Software or Support

CoffeeCup - HTML Editor, Flash & Web Design Software

Over 49,068,726 Downloads in 87 Countries

Tell a Friend About Our Cool Software

Buy the Book Here !

Chapter 4: Working With Table Rows


Each row in an HTML table is defined by a <tr> tag. The height of each row is by default determined automatically as the amount of space required to hold the contents of the tallest cell in the row plus the cell padding. The one exception to this rule is if you use the height attribute in the <td> tag as described in the next section. You can control other aspects of how the row is displayed using the attributes that are described in Table

NO XHTML The align and bgcolor attributes of the &ly;tr> tag are not supported in XHTML and are deprecated in HTML 4.01. You should use styles to control alignment and background color in table rows when you are authoring to these standards.

Table 4-2. Attributes of the <tr> tag.

 Attribute    Values  Description
 align  right, left, center,
 justify
 Determines the horizontal alignment of
 text or images with the cells of the row.
 The default is left.
 bgcolor  a color name, and
 rgb() value, or a hex
 value (#xxxxxx)
 Specifies the background color of
 the row.
 valign  top, middle, bottom  Determines the vertical alignment
 of content in cells of the row. The
 default is middle.

From this table you can conclude that individual table rows can have a different background color than the table as a whole--a useful technique for some more sophisticated page designs.

Now let's see how the valign attribute works. First of all, you must realize that this attribute has an effect only if the individual cell is taller than needed to hold its content. This will happen only when the content in another cell in the same row is larger, forcing the row height to increase. Displayed in Figure 4-5 is a two column, three row table where each row uses a different valign setting. Note that the second column contains dummy content in order to make the rows taller so the valign setting will have an effect. If you omit the valign attribute the middle alignment setting is used.

Valign table|
Figure 4-5. The effects of using different valign settings in the <tr> tag.


Table of Contents
Download Our Software:

... and don't forget about our Free Software

CoffeeCup Home Page | Software | Copyright & Legal | Site Map | © 1996 - 2008 CoffeeCup Software, Inc.