HTML <tr> tag

Updated: 10/11/2017 by Computer Hope

HTML tr tagWhen writing in HTML, the <tr> tag is used to designate a row of cells in a table and contains either <th> and <td> tags, or sometimes a mix of both. The following sections contain information about the <tr> tag, including an example of it in use, as well as related attributes and browser compatibility.

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

Example 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; this action allows us to improve its appearance.

Deprecated attributes

Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. Every attribute that was unique to the <tr> tag has been deprecated. While these attributes may work with the some versions of HTML, they will eventually be phased out. You should use CSS to adjust the dimensions and appearance of this element.

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


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

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