asp.net.ph

Skip Navigation LinksHome > Abakada: Back to Basics > Language References > HTML Elements > TR Element

<tr> Element


Denotes a row in a table.HTML 3.2, 4, 4.01, 5

HTML Syntax

Remarks

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 W3C 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.

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.

Attributes

The <tr> element has no attribute of its own, but supports global attributes common to all HTML elements.

Example

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>

External References

See Also

TABLE   TD   TH   Using Tables



Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note