basics of website design banner photo

HTML

HTML 5

CSS 2.1

CSS 3

Reference



HTML <caption> Element

The <caption> element defines a caption in an HTML table. The caption is defined immediately after the opening <table> tag and should convey information about the contents of the table.

The default browser behaviour is to display the caption above the table in the center.

Example of the <caption> element in use:

<table>
<caption>INCOME FOR THE LAST 3 YEARS</caption>
 <thead>
 <tr>
   <th>Year</th>
   <th>Earnings</th>
 </tr>
 </thead>
 <tfoot>
 <tr>
   <td>Total</td>
   <td>$25,000</td>
 </tr>
 </tfoot>
 <tbody>
 <tr>
   <td>2008</td>
   <td>$12,000</td>
 </tr>
 <tr>
   <td>2009</td>
   <td>$3,000</td>
 </tr>
 <tr>
   <td>2010</td>
   <td>$10,000</td>
 </tr>
 </tbody>
</table>

Result:

INCOME FOR THE LAST 3 YEARS
Year Earnings
Total $25,000
2008 $12,000
2009 $3,000
2010 $10,000

HTML 4 Element List