Name
tr — HTML 4.01 | HTML5
Synopsis
<tr> . . . </tr>
Defines a row of cells within a table. A tr
element may contain only some number of
td
and/or th
elements. It may be used only within a
table
, thead
, tfoot
, or tbody
element. Settings made in the tr
element apply to all the cells in that
row, however, the documented attributes below should be avoided in
favor of style sheet controls.
Start/End Tags
HTML: Required/Optional; XHTML: Required/Required
Attributes
Core, Internationalization, Events, HTML5 Global Attributes
align="left|right|center|justify|char"
Not in HTML5. Specifies the horizontal alignment of text in a cell or cells. The default value is
left
.bgcolor="
#rrggbb
"
or"
color name
"
Deprecated. Not in HTML5. Specifies a background color to be used in the row. A row’s background color overrides the color specified at the table level.
char="
character
"
Not in HTML5. Specifies a character along which the cell contents will be aligned when
align
is set tochar
. The default character is a decimal point (language-appropriate). This attribute is generally not supported.charoff="
length
"
Not in HTML5. Specifies the offset distance to the first alignment character on each line. If a line doesn’t use an alignment character, it should be horizontally shifted to end at the alignment position. This attribute is generally not supported by current browsers.
valign="top|middle|bottom|baseline"
Not in HTML5. Specifies the vertical alignment of text in the cells of a column.
Example
<table>
<tr> <td>cell ...
Get HTML & XHTML Pocket Reference, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.