Description

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

Syntax

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

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

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

<table>
    <tr>
        <th>No.</th>
        <th>Name</th>
        <th>Email</th>
    </tr>
    <tr>
        <td>1</td>
        <td>John Carter</td>
        <td>johncarter@mail.com</td>
    </tr>
    <tr>
        <td>2</td>
        <td>Peter Parker</td>
        <td>peterparker@mail.com</td>
    </tr>
    <tr>
        <td>3</td>
        <td>John Rambo</td>
        <td>johnrambo@mail.com</td>
    </tr>
</table>

Tag-Specific Attributes

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

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

Element
<tr>YesYesYesYesYes