The TR element is a part of the original
Simple Table Model and is also part of
the newer, backward compatible Complex
Table Model. It is a table structuring element that provides a
grouping scheme for individual table cells by table row.
Description:
This attribute specifies a background image to be placed in the current
table cell. All cell contents will be displayed over this image. If the
referenced image is smaller than the table cell size, it will be tiled to
fit all of the cell area. The value for this attribute indicates the URL
to reference the graphic.
Values:
Either an absolute or relative URL. All URLs should be URL encoded where required.
BGColor
[2|3|3.2|4]
[X1|X1.1]
[IE2|M|N3B1|O2.1]
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of CSS.
Required? No
Description:
This attribute sets the background color to be used for each cell in
this current row of table cells.
Description:
This attribute sets the internal border color to be used for each cell
in this current row of table cells. Display of this attribute is
dependent on the presence of the BORDER attribute in the
TABLE element.
Description:
This attribute allows independent, 3-D color control over the upper
and left hand borders of the internal cell border color for each cell
in this current row of table cells. To change the lower and right hand
borders of the internal cell border color for each cell in the current
row, use the BorderColorLight attribute (see below.) Display of this
attribute is dependent on the presence of the BORDER attribute in the
TABLE element.
Description:
This attribute allows independent, 3-D color control over the lower and
right hand borders of the internal cell border color for each cell in
this current row of table cells. To change the upper and left hand
borders of the internal cell border color for each cell in the current
row, use the BorderColorDark attribute (see above.) Display of this
attribute is dependent on the presence of the BORDER attribute in the
TABLE element.
Description:
This attribute specifies a character in the content of each cell of the current
row to be used to align the cell content (the first occurrence of the character
should be used.) The default value for this attribute is the decimal point
character for the current specified language.
Description:
This attribute specifies the spacing offset to the first occurrence of the
alignment character (specified by the CHAR attribute) on each line of the
cells in the current row. The direction of the offset is determined by the
current text direction (set with the DIR attribute or the BDO element.)
Description:
This is a standalone attribute which specifies that the data within the
current row will not use normal HTML linebreaking conventions. The
table cells in the row will enlarge to fit whatever data is specified in
the cells (unless explicit linebreaking elements are used.)
The HTML Tables specification says that end tags for the TR element
are not necessary. Browsers are typically more stringent with regards
to processing table structures - it is a very good idea to explicitly
close all table structure elements that have "optional" end tags. This
also gives your markup better readability and it can also help to
reduce confusion in case you need to edit your HTML pages by hand.
Make sure that the only content of your top-level TABLE elements are
TR elements or other valid organizational structures.
Also make sure that the only content of your TRs are
TH or TD elements. Otherwise, some browsers may
display table contents incorrectly.
The Table model (even the Simple Table Model) is easily the most
complex markup structure in HTML. If you have general questions about
this structure see the Table Overview.
If you are having problems with table layout and borders are turned
off, it can be helpful to temporarily turn them on - this can reveal
clues of why the layout is misbehaving.
DTD Note: HTML 3.2 did not contain the 'baseline'
value for the VALIGN attribute.
Compatibility Tip:
To enable Table cell contents to display well on browsers that do not
support tables, it is common practice to put either an extra space at
the end of each table cell, or even better, put a
<br> element at the end of the last cell in
each table row (eg: <tr> <td>cell 1</td> <td>cell
2<br></td></tr>.) This is perfectly legal HTML and
should cause no display problems for browsers that support tables (as
there is an implied line break anyway at the end of every table cell)
and should greatly improve readability on older browsers.
Browser Peculiarities
The latest Internet Explorer documentation states that WIDTH is a valid
attribute for this element, but my testing in all of the major versions
can not confirm this.
Opera 3.5-3.6x appears to not support the WRAP attribute. Opera versions
before and after this support it though.
[Test]
Netscape 4.x error condition bug: if a BGCOLOR and BACKGROUND attribute
have been specified for the row, and the URL to the image fails to
load, the bgcolor should be used instead. Netscape 4.x does that for
a moment, but then this changes to a block only the size of the broken
image placeholder with the specified BGCOLOR in the upper, left corner
of each of the cells in the row.