The HTML <tr> tag
Quick answer
The HTML <tr> element defines a table row. It contains the row's cells — <td> (data) and <th> (header) — and sits inside a <thead>, <tbody> or <tfoot>.
Overview
The <tr> (table row) element holds one horizontal row of cells. Its children are header cells (<th>) and data cells (<td>) — nothing else goes directly inside a row.
Rows belong to a table section: <thead>, <tbody> or <tfoot>. Even if you do not write a <tbody>, the browser inserts one implicitly, so every row ends up inside a section.
Style rows with CSS — zebra striping with :nth-child, a hover highlight, borders. The old per-row alignment attributes are obsolete, so reach for the stylesheet instead.
Syntax
<tr><th scope="row">Name</th><td>Ada</td></tr>
Example
<table border="1">
<tr><th>City</th><th>Country</th></tr>
<tr><td>Paris</td><td>France</td></tr>
</table>
Best practices
Frequently asked questions
What is the tr element?
How do I stripe alternate table rows?
Use the CSS
tr:nth-child(even) selector to give alternate rows a background color.Do table rows need a tbody?
You do not have to write one — the browser adds an implicit <tbody> — but writing it makes the structure explicit and stylable.