HTML <tr> Tag

Topic: HTML5 Tags ReferencePrev|Next


The <tr> (short for table row) element defines a row of cells in a table. The <tr> element acts as a container for table cells and contains one or more <th> or <td> elements.

The following table summarizes the usages context and the version history of this tag.

Parent: <thead>, <tfoot>, <tbody>
Content: <th>, <td>
Start/End Tag: Start tag: required, End tag: optional
Version: HTML 3.2, 4, 4.01, 5


The basic syntax of the <tr> tag is given with:

HTML / XHTML: <tr> ... </tr>

The example below shows the <tr> tag in action.

        <td>John Carter</td>
        <td>[email protected]</td>
        <td>Peter Parker</td>
        <td>[email protected]</td>
        <td>John Rambo</td>
        <td>[email protected]</td>

Tag-Specific Attributes

The following table shows the attributes that are specific to the <tr> tag.

Attribute Value Description
align left
Obsolete Specifies the horizontal alignment of each cell content within the table row.
bgcolor color Obsolete Sets the background color of each cell of the table row.
char character Obsolete Sets the character to which cell contents within a table row should align.
charoff number Obsolete Defines the number of characters by which cell contents within a table will be offset from the alignment characters specified by the char attribute.
valign top
Obsolete Specifies the vertical alignment of cell contents within a table row.

Global Attributes

Like all other HTML tags, the <tr> tag supports the global attributes in HTML5.

Event Attributes

The <tr> tag also supports the event attributes in HTML5.

Browser Compatibility

The <tr> tag is supported in all major modern browsers.

Browsers Icon

Basic Support—

  • Firefox 1+
  • Google Chrome 1+
  • Internet Explorer 2+
  • Apple Safari 1+
  • Opera 4+

Further Reading

See tutorial on: HTML Tables.

Other table-related tags: <table>, <thead>, <tfoot>, <tbody>, <caption>, <colgroup>, <col>, <th>, <td>.

Bootstrap UI Design Templates Property Marvels - A Leading Real Estate Portal for Premium Properties