English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML reference manual

HTML tag大全

HTML: <tr> etiqueta

HTML <tr> tag defines a row in an HTML table. Each <tr> tag can contain one or more <th> tags, which define header cells in the table, or one or more <td> tags, which define standard cells in the table. This tag is also commonly referred to as the <tr> element.

Online examples

HTML tables, simple tables with tr:

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>HTML tr tag usage (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 see ‹/›

In this HTML5In the document example, we used the <table> tag to create a table with2columns and3rows. The1row is defined by the first <tr> tag. It has2cells are defined by the <th> tag as table headers. The2Rows and the3Rows are defined by the <td> tag to define standard table cells.

Browser compatibility

IEFirefoxOperaChromeSafari

All mainstream browsers support the <tr> tag.

Definition and usage instructions

<tr> tag defines a row in an HTML table.

A <tr> element contains one or more <th> or <td> element.

HTML 4.01 with HTML5differences between

In HTML 5 Does not support <tr> tag in HTML 4.01 Any attribute within.

Atributo

AtributoValorDescrição
alignright
 left
 center
 justify
 char
HTML5 Não suportado. Define o alinhamento do conteúdo da linha da tabela.
bgcolorrgb(x,x,x)
#xxxxxx
colorname
HTML5 Não suportado. HTML 4.01 Descontinuado. Especifica a cor de fundo da linha da tabela.
charcharacterHTML5 Não suportado. Especifica o caractere a ser usado para alinhamento de texto.
charoffnumberHTML5 Não suportado. Especifica o deslocamento do primeiro caractere alinhado.
valigntop
 middle
 bottom
 baseline
HTML5 Não suportado. Especifica o alinhamento vertical do conteúdo da linha da tabela.

Atributos globais

A etiqueta <tr> suporta Atributos globais do HTML.

Atributos de evento

A etiqueta <tr> suporta Atributos de evento do HTML.

Experimente - Exemplo

Título na tabela
Este exemplo demonstra como exibir o título da tabela.

Célula vazia
Este exemplo demonstra como usar " " para lidar com células sem conteúdo.

Artigos relacionados

Tutorial HTML:Tabela HTML

Manual de referência do HTML DOM: Objeto Tr