HTML tr tag

Html tr element defines the table row. tr contains table data in the table cells.


The top populated countries
Countries Population Area Capital
India 1,382,323,332 3,287,263 New Delhi
Mexico 129,163,276 1,964,375 Mexico City
Try </>

Here, the tr defines a row of table. In the above example, the table has three rows defined by <tr> tags.

The caption element may also be used to write the title or the context of the table. It is centered automatically.

Related tags

<table> represents data in the form of a table.
<table> table structure </table>
<td> represents a data cell in a table.
<table> <tr><td> data cell </td></tr></table>
<th> represents a data cell in the heading section of the table.
<table> <tr><th> cell data in the heading section </th></tr></table>

Tag omission

End tag (</tr>) may be omitted.

Global Attributes

All the global attributes are applicable on the tr element.

Was this article helpful?




Get the newsletter