Adding a Caption

You can caption your table using the caption element.

<caption>. . . </caption>

Place your caption content between the opening and closing tag of the caption element. The caption goes directly beneath the opening table tag and is displayed by most browsers centered above the table (see Example 4-7).

Example 4-7. Adding a caption to the table
<table width="90%" border="1" cellspacing="5" cellpadding="5">
<caption>Comparing weather and time zones</caption>
<th>Tucson, Arizona</th>
<th>Las Vegas, Nevada</th>
<td>Warm to Hot</td>
<td>Warm to Hot</td>
<th>Time Zone</th>
<td>No Daylight Savings</td>
<td>Mountain Standard Time</td>

Figure 4-9 shows the results.

Figure 4-9. Adding a caption.

by BrainBellupdated