A simple HTML table, containing two columns and two rows:
![]()
The <tr> tag is supported in all major browsers.
The <tr> tag defines a row in an HTML table.
A <tr> element contains one or more <th> or <td> elements.
None of the HTML 4.01 attributes are supported in HTML5.
| Attribute | Value | Description |
|---|---|---|
| align | right left center justify char |
Not supported in HTML5. Aligns the content in a table row |
| bgcolor | rgb(x,x,x) #xxxxxx colorname |
Not supported in HTML5. Deprecated in HTML 4.01. Specifies a background color for a table row |
| char | character | Not supported in HTML5. Aligns the content in a table row to a character |
| charoff | number | Not supported in HTML5. Sets the number of characters the content will be aligned from the character specified by the char attribute |
| valign | top middle bottom baseline |
Not supported in HTML5. Vertical aligns the content in a table row |
The <tr> tag also supports the Global Attributes in HTML.
The <tr> tag also supports the Event Attributes in HTML.
Table headers
How to create table headers.
Empty cells
How to use " " to handle cells that have no content.
Table with a caption
An HTML table with a caption.
Tags inside a
table
How to display elements inside other elements.
Cells that span more than one row/column
How to define table cells that span more than one row or one column.
HTML tutorial: HTML Tables
HTML DOM reference: Tr object
Your message has been sent to W3Schools.