<tr> Tag Syntax
<body>
... flow content expected ...
<table>
...
<tr>
<td>...</td>
...
</tr>
...
</table>
</body>
Rules for coding the HTML tr element
Make sure you understand the difference between a tag and element and are familiar with the definitions of namespace and other HTML terms.
- Include a tr element inside a thead element, a tfoot element or an explicit or implied tbody element.
- Begin the tr element with a starting <tr> tag. The element name uses lower case letters and should be in the HTML namespace, which it will pick up automatically from the
xmlnsattribute on the <html> tag. - Inside the tr element, between the starting
<tr>tag and the ending</tr>tag, code the inner HTML for the cells of the table row. - End the tr element with a matching
</tr>closing tag.
tr Content Model
Child Elements of the <tr> tag
A table row can include the following elements:
- <th> tag(s)
- table column headings, which is normally coded in rows under a <thead> tag
- <td> tag(s)
- table detail cells, which can be coded in rows under a <tbody> tag or a <tfoot> tag