asp.net.ph

Skip Navigation LinksHome > Abakada: Back to Basics > Language References > HTML Elements > CAPTION Element

<caption> Element


Specifies a caption for the <table> element.HTML 3.2, 4, 4.01, 5

HTML Syntax

NOTE: A <caption> element’s end tag can be omitted if the caption element is not immediately followed by whitespace or a comment.

Remarks

The <caption> element specifies the caption or title of a <table> element.

When present, the <caption> element’s text should describe the nature of the table.

The caption element is only permitted immediately after the table start tag.

A table element may contain only one caption element.

Attributes

The <caption> element has no attribute of its own, but supports global attributes common to all HTML elements.

Example

The following shows how the <caption> element may be used.

<table>
<caption>This caption will appear above the table.</caption>
   ...
</table>
This caption will appear above the table.
Header 1 Header 2 Header 3
Cell 1 Cell 2 Cell 3
Cell 4 Cell 5 Cell 6

A table caption by default is center-aligned at the top of a table. The CSS properties text-align and caption-side can be used, though, to align and position the caption.

This example illustrates the concept.

 Show me 

External References

See Also

FIGCAPTION   TABLE



Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note