HTML Tr Tag - W3Schools
Maybe your like
Example
A simple HTML table with three rows; one header row and two data rows:
<table> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr></table> Try it Yourself »More "Try it Yourself" examples below.
Definition and Usage
The <tr> tag defines a row in an HTML table.
A <tr> element contains one or more <th> or <td> elements.
Browser Support
| Element | |||||
|---|---|---|---|---|---|
| <tr> | Yes | Yes | Yes | Yes | Yes |
Global Attributes
The <tr> tag also supports the Global Attributes in HTML.
Event Attributes
The <tr> tag also supports the Event Attributes in HTML.
More Examples
Example
How to align content inside <tr> (with CSS):
<table style="width:100%"> <tr> <th>Month</th> <th>Savings</th> </tr> <tr style="text-align:right"> <td>January</td> <td>$100</td> </tr></table> Try it Yourself »Example
How to add background-color to a table row (with CSS):
<table> <tr style="background-color:#FF0000"> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> Try it Yourself »Example
How to vertical align content inside <tr> (with CSS):
<table style="height:200px"> <tr style="vertical-align:top"> <th>Month</th> <th>Savings</th> </tr> <tr style="vertical-align:bottom"> <td>January</td> <td>$100</td> </tr></table> Try it Yourself »Example
How to create table headers:
<table> <tr> <th>Name</th> <th>Email</th> <th>Phone</th> </tr> <tr> <td>John Doe</td> <td>[email protected]</td> <td>123-45-678</td> </tr></table> Try it Yourself »Example
How to create a table with a caption:
<table> <caption>Monthly savings</caption> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself »Example
How to define table cells that span more than one row or one column:
<table> <tr> <th>Name</th> <th>Email</th> <th colspan="2">Phone</th> </tr> <tr> <td>John Doe</td> <td>[email protected]</td> <td>123-45-678</td> <td>212-00-546</td> </tr></table> Try it Yourself »Related Pages
HTML tutorial: HTML Tables
HTML DOM reference: TableRow object
CSS Tutorial: Styling Tables
Default CSS Settings
Most browsers will display the <tr> element with the following default values:
tr { display: table-row; vertical-align: inherit; border-color: inherit;} ❮ Previous Complete HTML Reference Next ❯ ★ +1 Sign in to track progressTag » Add Background Color To Tr Jquery
-
Change Tr Background-color - Jquery - Stack Overflow
-
How To Change The Background Color Of A Row In A Table?
-
Set Background Color For First Table Row In JQuery
-
Alternate Table Rows Color Using JQuery Or CSS - JS-Tutorials
-
Add Background Color And Border To Table Row On Hover Using Jquery
-
How To Change The Background Color Of A TR-row In A TABLE With ...
-
JQuery Change HTML Table Row Color On Hover
-
How To Change Background Color Using JQuery - Nathan Sebhastian
-
Change Background Color With Jquery Code Example - Code Grepper
-
How To Highlight A Table Row On Click Using JQuery - Codippa
-
Jquery Change Background Color Of Row
-
Changes Background Color Of Even Rows To Gray And Odd Rows To ...
-
How To Change A Row's Background-color Or Color Comparing Pieces ...
-
Dynamically Change Alternate Row Colors Using JQuery - Pakainfo