Easy Tutorial
❮ Av Prop Src Tag Picture ❯

HTML <tr> Tag

Example

A simple HTML table, containing two columns and two rows:


Browser Support

All major browsers support the <tr> tag.


Tag Definition and Usage

The <tr> tag defines a row in an HTML table.

A <tr> element contains one or more <th> or <td> elements.


Differences Between HTML 4.01 and HTML5

In HTML5, any attributes that were supported in HTML 4.01 for the <tr> tag are no longer supported.


Attributes

Attribute Value Description
align right <br>left <br>center <br>justify <br>char Not supported in HTML5. Defines the alignment of content within the table row.
bgcolor rgb(x,x,x)<br>#xxxxxx<br>colorname Not supported in HTML5. Deprecated in HTML 4.01. Specifies the background color of the table row.
char character Not supported in HTML5. Specifies the character to align text on.
charoff number Not supported in HTML5. Specifies the offset of the first aligned character.
valign top <br>middle <br>bottom <br>baseline Not supported in HTML5. Specifies the vertical alignment of content in the table row.

Global Attributes

The <tr> tag supports HTML's global attributes.


Event Attributes

The <tr> tag supports HTML's event attributes.


Try It - Examples

Table Headers

Empty Cells

Table with Caption

Tags Inside a Table

Table Cells Spanning Multiple Rows/Columns


Related Articles

HTML Tutorial: HTML Tables

HTML DOM Reference: Tr Object

❮ Av Prop Src Tag Picture ❯