HTML Tags

HTML <tr> Tag

The <tr> tag in HTML defines a table row.
It is used inside the <table> element to group one or more table cells (<th> or <td>) in a single horizontal row.

Syntax

html

<tr>
  <td>Cell 1</td>
  <td>Cell 2</td>
</tr>

Attributes

AttributeDescription
alignSpecifies the horizontal alignment of content in a row (deprecated).
bgcolorSpecifies the background color of a row (deprecated).
valignSpecifies the vertical alignment of content in a row (deprecated).

⚠️ These attributes are deprecated. Use CSS instead for layout and styling.

Example

html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>HTML tr Tag Example</title>
</head>
<body>
  <h2>Example of the <tr> Tag</h2>
  <table border="1">
    <tr>
      <td>January</td>
      <td>$100</td>
    </tr>
    <tr>
      <td>February</td>
      <td>$150</td>
    </tr>
  </table>
</body>
</html>

Output

Browser Output

html

Use our TryIt Editor to see the output

Browser Support

Chrome
Edge
Firefox
Safari
Opera
IE9+
YesYesYesYesYesYes

All modern browser support <tr> html tag

Notes

Conclusion

In simple terms, the <tr> tag helps organize your table data horizontally - each <tr> creates one complete row of information, making your table more structured and readable.