Latest web development tutorials

HTML <tr> tag

Examples

A simple HTML table, containing two two lines:

<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>

try it"
(For more examples, see the bottom of the page)

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support <tr> tag.


Tag definitions and instructions

<Tr> tag defines an HTML table row.

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


Differences between HTML 4.01 and HTML5

In HTML 5 is not supported <tr> tag any attribute in HTML 4.01 in.


Attributes

属性 描述
align right
left
center
justify
char
HTML5 不支持。定义表格行的内容对齐方式。
bgcolor rgb(x,x,x)
#xxxxxx
colorname
HTML5 不支持。HTML 4.01 已废弃。 规定表格行的背景颜色。
char character HTML5 不支持。规定根据哪个字符来进行文本对齐。
charoff number HTML5 不支持。规定第一个对齐字符的偏移量。
valign top
middle
bottom
baseline
HTML5 不支持。规定表格行中内容的垂直对齐方式。


Global Properties

<tr> tag supports HTML global properties .


Event Properties

<tr> tag supports HTML event properties .


Examples

Try - Example

Table title
This example demonstrates how to display table headers.

Empty Cells
This example demonstrates how to use the "& nbsp;" no content processing cell.

Table with headings
This example demonstrates with a title (caption) form.

Tags within the table
This example demonstrates how to display elements inside other elements.

Interbank across columns or table cell
This example demonstrates how to define cross or across columns of a table cell.


related articles

HTML Tutorial: HTML table

HTML DOM Reference: Tr Object