Posts in current category

HTML5 <tr> tag


May 03, 2021 20:00 HTML5


Table of contents


Instance

HTML5 labels are used to represent rows in a table. Please refer to the following example:

A simple HTML table with two columns and two rows:

<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
Try it out . . .
(See bottom of page for more examples)

Browser support

HTML5 <tr> tag HTML5 <tr> tag HTML5 <tr> tag HTML5 <tr> tag HTML5 <tr> tag

All major browsers support the hashtag.


Label definition and instructions for use

The label defines the rows in the HTML table.

An element contains one or more elements.


The difference between HTML 4.01 and HTML5

In HTML 5, any properties of the label in HTML 4.01 are not supported.


Property

Property Value Describe
align right
left
center
justify
char
HTML5 is not supported. Defines the alignment of the contents of table rows.
bgcolor rgb(x,x,x)
#xxxxxx
colorname
HTML5 is not supported. H TML 4.01 is obsolete. Specifies the background color of the table row.
char character HTML5 is not supported. Specify which character to align the text against.
charoff number HTML5 is not supported. Specifies the offset of the first aligned character.
valign top
middle
bottom
baseline
HTML5 is not supported. Specifies the vertical alignment of content in a table row.


Global properties

Labels support the global properties of HTML.


The event property

The tag supports the event properties of HTML.


HTML5 <tr> tag

Try it - instance

The title in the table
This example shows how to display the table title.

Empty cell
This example shows how to use to work with cells without content.

Table with title
This example shows a table with a title.

The label in the table
This example shows how to display elements within other elements.

Table cells that span rows or columns
This example shows how to define table cells that span rows or columns.


Related articles

HTML tutorial: HTML tables

HTML DOM Reference Manual: Tr Object