HTML Tag Reference - HTML tag <tr>

This <tr> element creates a single row inside a <table> element. In turn, the cells in each row are created by the <td> element.

Browser compatibility

<tr> Yes Yes Yes Yes Yes

What's new in HTML5

All the layout attributes are deprecated in HTML5.


Attribute Value Description
align right
Not supported in HTML5.
Align the table row content
bgcolor rgb(x,x,x)
Not supported in HTML5.
Set a table row background color
char character Not supported in HTML5.
Align the table row content to a character
charoff number Not supported in HTML5.
Sets the number of characters to align the content from the character in the char attribute
valign top
Not supported in HTML5.
Vertical aligns the table row content

Global Attributes

The <tr> tag supports the Global Attributes in HTML.

Event Attributes

The <tr> tag supports the Event Attributes in HTML.

Default CSS Settings

tr {
    display: table-row;
    vertical-align: inherit;
    border-color: inherit;


               <td>Cell 1</td>
               <td>Cell 2</td>
               <td>Cell 3</td>
               <td>Cell 4</td>
</body><!--from   w  ww .  jav a 2>

Click to view the demo

rowspan attribute

The integer value of this attribute determines how many table rows a cell spans.

     <table border="1">
               <th rowspan="2">Cell 1</th>
               <th>Cell 2</th>
               <th rowspan="3">Cell 3</th>
               <th>Cell 4</th>
               <th>Cell 5</th>
               <th rowspan="3">Cell 7</th>
               <th rowspan="2">Cell 9</th>
               <th>Cell 10</th>
               <th>Cell 6</th>
               <th>Cell 11</th>
               <th>Cell 12</th>
               <th>Cell 8</th>
               <th>Cell 13</th>
               <th>Cell 14</th>
</body><!--from w  w  w  . jav a  2s .  c om-->

Click to view the demo