HTML tag
Example
A simple HTML table with two columns and two rows:
| Month | Savings |
|---|---|
| January | $100 |
Try it »
(More examples are at the bottom of the page)
Browser support





All major browsers support the tag.
Tag Definition and Usage Notes
The tag defines a row in an HTML table.An element contains one or more or .
Differences between HTML 4.01 and HTML5
In HTML5, none of the attributes of the tag defined in HTML 4.01 are supported.
property
| property | Value | Description |
|---|---|---|
| align | right |
left
center
justify
char | HTML5 does not support。定义表格行的内容对齐方式。 |
| bgcolor | rgb(x,x,x)
#xxxxxx
colorname | Not supported in HTML5. Deprecated in HTML 4.01. Specifies the background color of a table row. | | char | character | Not supported in HTML5. Specifies which character to align text on. | | charoff | number | Not supported in HTML5. Specifies the offset of the first alignment character. | | valign | top
middle
bottom
baseline | Not supported in HTML5. Specifies the vertical alignment of content in a table row. |
Global Attributes
The tag supports [HTML Global Attributes](/tags/ref-standardattributes.html).Event attribute
The tag supports [HTML Event Attributes](/tags/ref-eventattributes.html).Try it - Example
Caption in a table
This example demonstrates how to display a table caption.
Empty cells
This example demonstrates how to use " " to handle cells with no content.
A table with a caption
This example demonstrates a table with a caption.
Tags inside a table
This example demonstrates how to display elements inside other elements.
Table cells spanning rows or columns
This example demonstrates how to define table cells that span rows or columns.
Related Articles
HTML Tutorial:HTML Tables
HTML DOM Reference Manual: Tr Object