HTML <tr> (Table Row) Tag
Example
<table>
<thead>
<tr>
<th>Heading</th>
<th>Heading</th>
</tr>
</thead>
<tbody>
<tr>
<td>Data</td>
<td>Data</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Foot data</td>
<td>foot data</td>
</tr>
</tfoot>
</table>
Meaning
The <tr> element specifies a row in a table. The individual cells of the row are defined by the <th> and <td> elements.
Note:
- This tag is contained only in the <table>, <thead>, <tbody>, and <tfoot> tags and it only contains the <th> and <td> tags.
- Under the XHTML 1.0 specification, the closing <tr> tag is required, but under older HTML and HTML5, the closing tag is optional(always close).
- There are extended DOM methods for table-related tags like <tr>, including insertRow() and deleteRow().
Version: HTML 3.2, 4, 4.01, 5
Standard Syntax
<tr>...</tr>
Browser Support
Status
Global Attributes
The <tr> element also supports the Global Attributes in HTML.
Event Attributes
The <tr> element also supports the Event Attributes in HTML.
By Default CSS Value(s)
Most of the browsers will display the <tr> element with the following by default value(s)
tr {
display: table-row;
vertical-align: inherit;
border-color: inherit;
}