English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
HTML <tr> tag defines a row in an HTML table. Each <tr> tag can contain one or more <th> tags, which define the header cells in the table, or one or more <td> tags, which define the standard cells in the table. This tag is also commonly referred to as the <tr> element.
HTML tables, simple tables with tr:
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>Use of HTML tr tag (Basic Tutorial Website oldtoolbag.com)</title> </head> <body> <table border="1"> <tr> <th>Column 1 Heading</th> <th>Column 2 Heading</th> </tr> <tr> <td>Data in Column 1, Row 2</td> <td>Data in Column 2, Row 2</td> </tr> <tr> <td>Data in Column 1, Row 3</td> <td>Data in Column 2, Row 3</td> </tr> </table> </body> </html>Test to see ‹/›
In this HTML5In the document example, we used the <table> tag to create a table that has2columns and3rows. The1row is defined by the first <tr> tag. It has2title cells of the table are defined by the <th> tag. The2row and the3rows are defined by the <td> tag to define standard table cells.
IEFirefoxOperaChromeSafari
All mainstream browsers support the <tr> tag.
The <tr> tag defines a row in an HTML table.
a <tr> element contains one or more <th> or <td> element.
in HTML 5 does not support the <tr> tag in HTML 4.01 Any attribute within.
Attribut | Valeur | Description |
---|---|---|
align | right left center justify char | HTML5 Non pris en charge. Définir la manière dont le contenu de la ligne de tableau est aligné. |
bgcolor | rgb(x,x,x) #xxxxxx colorname | HTML5 Non pris en charge. HTML 4.01 Déprécié. Définir la couleur de fond de la ligne de tableau. |
char | character | HTML5 Non pris en charge. Définir selon quel caractère aligner le texte. |
charoff | number | HTML5 Non pris en charge. Définir l'offset du premier caractère aligné. |
valign | top middle bottom baseline | HTML5 Non pris en charge. Définir la manière dont le contenu vertical des lignes de tableau est aligné. |
Balise <tr> prise en charge Attributs globaux HTML。
Balise <tr> prise en charge Attributs d'événement HTML。
Titre du tableau dans le tableau
Ce exemple montre comment afficher le titre du tableau.
Cellule vide
Ce exemple montre comment utiliser " " pour traiter les cellules sans contenu.
Tutoriel HTML :Tableau HTML
Manuel de référence HTML DOM : Objet Tr