English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
O elemento <thead> da HTML define um grupo de linhas que definem os cabeçalhos das colunas da tabela. Essas linhas constituem os cabeçalhos das colunas da tabela HTML. Este tag é também conhecido como elemento <thead>.
Tabela HTML com elemento <thead>:
!doctype html> <html> <head> <meta charset="UTF-8"> <title>Uso do tag <thead> HTML (Tutorial básico da Web oldtoolbag.com)</title> </head> <body> <table border="1"> <caption>Budget do Conselho (em £)< 2018</caption> <thead> <tr> <th scope="col">Itens</th> <th scope="col">Despesa</th> </tr> </thead> <tbody> <tr> <th scope="row">Donuts</th> <td>3,000</td> </tr> <tr> <th scope="row">Stationery</th> <td>18,000</td> </tr> </tbody> </table> </body> </html>Teste e veja ‹/›
IEFirefoxOperaChromeSafari
Todos os navegadores populares suportam a tag <thead>.
O tag <thead> é usado para combinar o conteúdo do cabeçalho da tabela HTML.
O elemento <thead> deve ser usado com <tbody> e <tfoot> elementos combinados para definir as partes de uma tabela (cabeçalho, corpo, pé).
Ao usar esses elementos, permite que o navegador suporte a rolagem do corpo da tabela independentemente do cabeçalho e pé da tabela. Quando uma tabela longa com várias páginas é impressa, o cabeçalho e pé da tabela podem ser impressos em cada página que contém dados da tabela.
O <thead> tag deve ser usado nas seguintes situações: como filho do elemento <table>, aparecendo após os elementos <caption> e <colgroup>, antes de <tbody>. antes de <tfoot> e <tr> elementos.
Notas:<thead> elemento deve conter um ou mais <tr> tags.
Tip:<thead>, <tbody>, and <tfoot> elements do not affect the table layout by default. However, you can use CSS to define styles for these elements, thus changing the appearance of the table.
In HTML 5 In the <thead> tag, HTML is no longer supported. 4.01 Any attribute of the <thead> tag.
Attribute | Value | Description |
---|---|---|
align | right left center justify char | HTML5 Not supported. Defines the alignment method of the content within the <thead> element. |
char | character | HTML5 Not supported. Specifies which character the content of the <thead> element is aligned to. |
charoff | number | HTML5 Not supported. Specifies the offset of the first alignment character in the content of the <thead> element. |
valign | top middle bottom baseline | HTML5 Not supported. Specifies the vertical alignment of the content within the <thead> element. |
Support for <thead> tag Global attributes of HTML.
Support for <thead> tag HTML event attributes.