<caption>: The HTML Caption Element
1 Description
The HTML <caption>
element is used
to provide a caption to HTML <table>
elements. There may only be one <caption>
element per HTML
<table>
element. The <caption>
element should
be the first child of the <table>
element.
2 Examples
<!DOCTYPE html>
<html>
<head>
<title>Example Page</title>
</head>
<body>
<h1>A Table With A Caption</h1>
<table>
<caption>Weather For This Upcoming Week</caption>
<thead>
<tr>
<th colspan="3">Weather For The Next 3 Days</th>
</tr>
<tr>
<th>Day</th>
<th>Overnight Low (Fahrenheit)</th>
<th>Daily High (Fahrenheit)</th>
</tr>
</thead>
<tbody>
<tr>
<td>2025-04-01, Tuesday</td>
<td>41 degrees</td>
<td>69 degrees</td>
</tr>
<tr>
<td>2025-04-02, Wednesday</td>
<td>45 degrees</td>
<td>72 degrees</td>
</tr>
<tr>
<td>2025-04-03, Thursday</td>
<td>44 degrees</td>
<td>76 degrees</td>
</tr>
</tbody>
</table>
</body>
</html>
This document was last updated: