Resumo
O Elemento HTML <caption>
(ou Elemento HTML de Legenda de Tabela) representa o título da tabela. Embora seja sempre o primeiro elemento de cima para baixo em uma {{HTMLElement("table")}}, através de CSS é possivel coloca-lo em outra posição.
Nota de uso: Quando o elemento {{HTMLElement("table")}} que é pai do elemento {{HTMLElement("caption")}} é o unico descendente de um elemento {{HTMLElement("figure")}} , use o elemento {{HTMLElement("figcaption")}} .
- Content categories None.
- Permitted content Flow content.
- Tag omission {{no_tag_omission}}
- Permitted parent elements A {{HTMLElement("table")}} element, as its first descendant.
- DOM interface {{domxref("HTMLTableCaptionElement")}}
Atributos
This element includes the global attributes.
- {{htmlattrdef("align")}} {{deprecatedGeneric('inline','HTML4.01')}} {{obsoleteGeneric('inline','HTML5')}}
-
This enumerated attribute indicates how the caption must be aligned with respect to the table. It may have the following values:
left
, displayed to the left of the tabletop
, displayed before the the tableright
, displayed to the right of the tablebottom
, displayed under the table
Exemplos
Please see the {{HTMLElement("table")}} page for examples on {{HTMLElement("caption")}}
Especificações
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', 'tabular-data.html#the-caption-element', '<caption>')}} | {{Spec2('HTML WHATWG')}} | |
{{SpecName('HTML5 W3C', 'tabular-data.html#the-caption-element', '<caption>')}} | {{Spec2('HTML5 W3C')}} | |
{{SpecName('HTML4.01', 'struct/tables.html#h-11.2.2', '<caption>')}} | {{Spec2('HTML4.01')}} |
Navegadores compatíveis
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatGeckoDesktop("1.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatGeckoMobile("1.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Veja Também
- Other table-related HTML Elements: {{HTMLElement("col")}}, {{HTMLElement("colgroup")}}, {{HTMLElement("table")}}, {{HTMLElement("tbody")}}, {{HTMLElement("td")}}, {{HTMLElement("tfoot")}}, {{HTMLElement("th")}}, {{HTMLElement("thead")}}, {{HTMLElement("tr")}};
- CSS properties that may be specially useful to style the {{HTMLElement("caption")}} element:
- {{cssxref("text-align")}}, {{cssxref("caption-side")}}.
{{HTMLRef}}