HTML | PHP | Forum

HTML <caption> tag


<caption> - </caption>

Definition and Usage

The CAPTION elements provides a brief summary of the table's contents or purpose. The <caption> tag must immediately follow the <table> tag and precede all other tags. The width of the caption is determined by the width of the table.the caption's position as displayed in the browser can be controlled with the align attribute.

Optional Attributes

Attribute Value Description
align left
Caption's alignment. Deprecated in favor of style shhets.

Standard Attributes

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.

Event Attributes

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.


Source Output
<table border="2">
<caption>This is a sample caption</caption>
<td>Content 1</td>
<td>Content 2</td>
This is a sample caption
Content 1 Content 2


Learn HTML
HTML Tutorial

HTML Reference
HTML by function
HTML by Alphabet

HTML events
HTML attributes
HTML color names

<h1> to <h6>


Copyright 2005-8 Sunilcare.  All Rights Reserved.
Comments or suggestions? Contact us.About us