Last Updated on April 26, 2023 by Roshan Parihar
Definition of HTML tr tag
HTML tr tag is used to show HTML table row. A table can contain many numbers of rows. We can define the HTML table row using this tag.
Table can display with rows and columns. Each row can have any number of cells (columns). Let’s explain HTML tr tag with the topics given in the table:
Table of Content
Syntax:
1 2 3 |
<tr> A table cell comes inside here... </tr> |
The syntax showing the start and end tr tag to show HTML table row. In each tr tag, there can be any number of table cells.
Table with one row
This is the example showing one row. The example contains the country name with national game.
1 2 3 4 5 6 7 |
Name of country with national game: <table> <tr> <td>India</td> <td>Hockey</td> </tr> </table> |
Output
India | Hockey |
Table with more than one row
This is the example showing more than one row. The example contains the name of players with country name.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
Name of cricket players: <table> <tr> <th>Name</th> <th>Team</th> </tr> <tr> <td>Virat Kohli</td> <td>India</td> </tr> <tr> <td>Chris Gayle</td> <td>West Indies</td> </tr> <tr> <td>Lasith Malinga</td> <td>Sri Lanka</td> </tr> <tr> <td>Dwayne Bravo</td> <th>West Indies</td> </tr> </table> |
Output
Name | Team |
---|---|
Virat Kohli | India |
Chris Gayle | West Indies |
Lasith Malinga | Sri Lanka |
Dwayne Bravo | West Indies |
List of attributes of HTML tr tag
Sr. No. | Attribute Name | Description |
---|---|---|
1 | align |
|
2 | bgcolor |
|
3 | char |
|
4 | charoff |
|
5 | valign |
|
Resources and References of HTML table row
1. W3C Specification.
2. HTML living standard
3. W3C project using Github