HTML <tr> tag

Updated: 09/12/2023 by Computer Hope
HTML tr tag

The HTML (hypertext markup language) <tr> tag is short for table row and used to designate a row of cells in a table and can contain <th> and <td> tags. The following sections contain information about the <tr> tag, including an example of it in use, and related attributes and browser compatibility.


More advanced tables may include the <caption>, <col>, <colgroup>, <tbody>, <tfoot>, or <thead> elements.

Example of <tr> code

<table class="mtable2 tab">
<tr class="tcw">
<tr class="tcw">
<tr class="tcw"> <td>May</td>

Example result

Month Savings
March $200
April $300
May $250

We have added a few of our own classes to the table using CSS (cascading style sheets); this action allows us to improve its appearance.

Deprecated attributes

All HTML tags support standard attributes that define the settings of an HTML element. In addition to the standard settings, the <tr> tag had the following unique attributes that are now deprecated.

Attribute Description
align Designates the alignment of content inside an element.
bgcolor Designates the background color of a table row.
char Aligns the content in a table row to a specific character.
charoff Sets the number of characters to offset the content from the character designated by the char attribute.
valign Alights the content in a table row vertically.


Edge Internet Explorer Firefox Safari Opera Chrome
All versions All versions All versions All version All versions All versions

Abbreviations, Browser, Cell, Class, Column, Compatibility, Container tag, Format, Row, <table>, Web design terms