W3 3.2y
4.0y
NS 3.0y
4.0y
IE 3.0y
4.0y
TV 1.2y
2.1y

<TR>...</TR>

Description

Define a row inside a table. Inside the row you can put table headers and/or table data using the TH and TD elements.

The attribute settings ALIGN, BGCOLOR, VALIGN set these values for all TD/TH elements inside the row if they are not overruled by settings in the TD/TH elements.

DTD

<!ELEMENT TR       - O (TH|TD)+        -- table row -->
<!ATTLIST TR                           -- table row --
  %attrs;                              -- %coreattrs, %i18n, %events --
  %cellhalign;                         -- horizontal alignment in cells --
  %cellvalign;                         -- vertical alignment in cells --
  >
from the HTML 4.0 DTD, "Copyright © W3C, (MIT, INRIA, Keio). All Rights Reserved."

Attributes

Core attributes: class id style title
Internationalization attributes: dir lang
Events: onclick ondblclick onmousedown onmouseup onmouseover onmousemove onmouseout onkeypress onkeydown onkeyup

W3 3.2y
4.0y
NS 3.0y
4.0y
IE 3.0y
4.0y
TV 1.2y
2.1y
ALIGN
Set the horizontal alignment of the contents of the cells in the table row. Possible values are :

Value Description
center The contents of table cells are centered.
char This attribute defines that the contents of table cells must be centered around a certain character. Which character this is, is defined with the char attribute.

If no char attribute is given, a default character is used. This is the character that is defined to represent the decimal point in the current language. In English this is the period ("."), in Dutch it is the comma (",").

justify The contents of table cells is evenly spread between the left and right border of a table cell. This is achieved by enlarging the space between each word on a line.

This value is not supported by WebTV.

left The contents of table cells are aligned to the left side.
right The contents of table cells are aligned to the right side.


W3 3.2n
4.0n
NS 3.0n
4.0y
IE 3.0y
4.0y
TV 1.2n
2.1n
BACKGROUND
Supply an image that is used as the background of all the cells in the row. You can use images in the GIF and JPEG format.
W3 3.2n
4.0d
NS 3.0y
4.0y
IE 3.0y
4.0y
TV 1.2y
2.1y
BGCOLOR
Set the background color of the row. This color overrules the background color set with the TABLE element.
See the page Using colors for a description on specifying colors.
W3 3.2n
4.0n
NS 3.0n
4.0n
IE 3.0y
4.0y
TV 1.2n
2.1n
BORDERCOLORLIGHT
Sets the color of one of the two colors used to draw a 3-D border around the cells in the row, the other is set with BORDERCOLORDARK. This attribute only has effect if the table has a border. This value overrules a color set at the table level, but can be overruled at the cell level.
See the page Using colors for a description on specifying colors.
W3 3.2n
4.0n
NS 3.0n
4.0n
IE 3.0y
4.0y
TV 1.2n
2.1n
BORDERCOLORDARK
Sets the color of one of the two colors used to draw a 3-D border around the cells in the row, the other is set with BORDERCOLORLIGHT. This attribute only has effect if the table has a border. This value overrules a color set at the table level, but can be overruled at the cell level.
See the page Using colors for a description on specifying colors.
W3 3.2n
4.0y
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2n
2.1n
CHAR
When you specify align="char", this attribute specifies which character must be used to center the text around.

When more than one occurrence of the character is present, the first occurrence is used.


W3 3.2n
4.0y
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2n
2.1n
CHAROFF
This attribute specifies an offset that must be used when align="char" is used. The value can be specified as a number of pixels, or as a percentage of the current width.

This offset is added to the position where the character to center around is. The direction of the offset depends on the current direction of the text.

When the alignment character isn't present in the line, the text is shifted, so that the text ends at the offset.


W3 3.2n
4.0n
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2n
2.1y
NOWRAP
Using this attribute assures the automatic layout system of the table will not wrap the contents of the cells of this row, if necessary.
You do not need to specify a value for this attribute.

The WebTV interface will override this attribute (if necessary) to fit text on-screen when accessing a Web site with a WebTV system.


W3 3.2n
4.0n
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2y
2.1y
TRANSPARENCY
With version 1.1 of the WebTV interface, use the transparency attribute for the background color for cells in a row. The value for the transparency attribute can range from 0 (fully opaque) to 100 (fully transparent). The default value for transparency is 0. Note that the WebTV interface has implemented optimizations for a transparency value of 50 that make pages draw faster.
W3 3.2y
4.0y
NS 3.0y
4.0y
IE 3.0y
4.0y
TV 1.2y
2.1y
VALIGN
Set the vertical alignment of the contents of the cells in the table row. Possible values are :

Value Description
baseline The first line of the contents of the cell are aligned with a common baseline.
bottom The text in each cell in the column is aligned at the bottom of the cell.
middle The text is centered vertically in each cell.
top The text in each cell is aligned at the top of the cell.

Examples

Source
<TABLE border="5" width="100%" cellspacing="10" bgcolor="#a080a0"
bordercolor="#0000a0" bordercolorlight="#0000ff" bordercolordark="#000050">
<TR align="right" bgcolor="#80a080" valign="bottom">
<TD height="75"><SPAN style="color: #000">Hello</SPAN></TD>
<TD bgcolor="#a0a080"><SPAN style="color: #000">how</SPAN></TD>
<TD align="left"><SPAN style="color: #000">are</SPAN></TD>
<TD valign="middle"><SPAN style="color: #000">you?</SPAN></TD>
</TR>
<TR bordercolorlight="#ff0000" bordercolordark="#ffff00" valign="middle">
<TD bordercolordark="#ffffff"><SPAN style="color: #000">Left cell</SPAN></TD>
<TD height="75"><SPAN style="color: #000">Right cell</SPAN></TD>
</TR>
</TABLE>
 
Result
Hello how are you?
Left cell Right cell
Statistics