<tr> tag

HTML <tr> tag

The <tr> tag defines a row in HTML table.

Syntax:
<tr>….</tr>

Example

<table>
  <tr>
    <th>Flowers</th>
    <th>colors</th>
  </tr>
  <tr>
    <td>Rose</td>
    <td>Red</td>
  </tr>
  <tr>
    <td>Lotus</td>
    <td>Pink</td>
  </tr>
</table>

Default CSS Values

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

Difference between HTML4.01, XHTML and HTML5

HTML4 XHTML HTML5
No difference No difference All the layout attributes of the <tr> tag are deprecated in HTML5

Attributes used with <tr> tag

Attribute Description
align Describes the alignment of the content of a row of the table based on nearby elements. The alinment can be left, right, justify, center, or char,
(HTML5 does not support this attribute when it is used with the <tr> tag).
bgcolor Describes the background color of a row.
(HTML5 does not support this attribute when it is used with the <tr> tag).
char Sets the alignment of the content of the row of the table to a character. The default value of char is decimal-point character.
(HTML5 does not support this attribute with this tag).
charoff Sets the character offset of the table row i.e. the number of characters the content of a row will align from a particular specified character.
(HTML5 does not support this attribute with this tag).
valign To align the content of a row of the table vertically at top, bottomp, middle, or baseline.
(HTML5 does not support this attribute).

Global Attributes

The <tr> tag supports Global attributes.

Event Attributes

The <tr> tag supports Event attributes.

Supporting Browsers

supporting-browsers for tags

Related Tags

<table><td><th><caption><thead><tfoot><colgroup> & <col> tags

Tutorials for all brains!