Denotes a row in a table. | HTML 3.2, 4, 4.01, 5 |
HTML Syntax
<table>
<tr> .... </tr>
...
</table>
A <tr
> element’s end tag can be omitted if the <tr
> element is immediately followed by another <tr
> element, or if there is no more content in the parent element.
The <tr
> element specifies a table row.
<tr
> elements can only be used within a <table> element.
Each <tr
> element can contain <th> elements, which indicate table headings, and <td> elements, which indicate the table data cells.
Although the HTML standard specifies that <tr
> end tags are optional and may be omitted, it is safer to always close table rows, as not all browsers support this recommendation, and may produce unexpected results.
The <tr>
element has no attribute of its own, but supports global attributes common to all HTML elements.
The following shows how the <tr
> element may be used.
<table>
<tr><th>This is the header row.</th></tr>
<tr><td>This is the first row.</td></tr>
<tr><td>This is the second row.</td></tr>
</table>
TABLE TBODY TD TFOOT THEAD TH Using Tables