<tr> (Table Row)
This element specifies a row in a table. The individual cells of the row are defined by the <th> and <td> elements.
align="center | justify | left | right"</tr>
bgcolor="color name | #RRGGBB" (transitional only)
dir="ltr | rtl"
id="unique alphanumeric identifier"
valign="baseline | bottom | middle | top"
td or th elements only
Attributes Defined by Internet Explorer
bordercolor="color name | #RRGGBB" (4)
bordercolordark="color name | #RRGGBB" (4)
bordercolorlight="color name | #RRGGBB" (4)
hidefocus="true | false" (5.5)
Standard Event Attributes
onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup
Events Defined by Internet Explorer
onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfilterchange, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresize, onresizeend, onresizestart, onselectstart, ontimeerror
Element Specific Attributes
- This attribute is used to align the contents of the cells within the <tr> element. Common values are center, justify, left, and right.
- This attribute specifies a background color for all the cells in a row. Its value can be either a named color, such as red, or a color specified in the hexadecimal #RRGGBB format, such as #FF0000.
- This attribute, supported by Internet Explorer and Netscape, is used to set the border color for table cells in the row. The attribute should be used only with a positive value for the border attribute. The value of the attribute can be either a named color, such as green, or a color specified in the hexadecimal #RRGGBB format, such as #00FF00.
- This Internet Explorer-specific attribute specifies the darker of two border colors used to create a three-dimensional effect for the cell's borders. It must be used with the border attribute set to a positive value. The attribute value can be either a named color, such as blue, or a color specified in the hexadecimal #RRGGBB format, such as #00FF00.
- This Internet Explorer-specific attribute specifies the lighter of two border colors used to create a three-dimensional effect for a cell's borders. It must be used with the border attribute set to a positive value. The attribute value can be either a named color, such as red, or a color specified in the hexadecimal #RRGGBB format, such as #FF0000.
- This attribute is used to define the character to which element contents are aligned when the align attribute is set to the char value.
- This attribute contains an offset as a positive or negative integer to align characters as related to the char value. A value of 2, for example, would align characters in a cell two characters to the right of the character defined by the char attribute.
- This attribute is used to set the vertical alignment for the table cells with the <tr> element. HTML 4.01 defines baseline, bottom, middle, and top. Internet Explorer replaces middle with center; the effect should be the same.
<table width="300" border="1">
<tr bgcolor="red" align="center" valign="middle">
HTML 3.2, 4, 4.01, XHTML 1.0, 1.1, Basic
Internet Explorer 2, 3, 4, 5, 5.5, 6
Netscape 1.1, 2, 3, 4, 4.5-4.8, 6, 7
This element is contained by the <table>, <thead>, <tbody>, and <tfoot> elements. It contains the <th> and <td> elements.
The HTML 3.2 specification defines only the align and valign attributes for this element.
Under the XHTML 1.0 specification, the closing </tr> tag ceases to be optional.