Building Your Learning Module...
Getting things ready for you!
Find videos you like?
Save to resource drawer for future reference!
The <caption> element provides a title or description for a table. It's placed directly after the opening <table> tag and serves as a label for the entire table, improving both accessibility and usability.
<table>
<caption>
Table Description
</caption>
<!-- rest of table -->
</table>The caption appears as a label that describes what the table contains. It's semantically associated with the table and helps users understand the data.
Table with descriptive caption
<h3>Basic Table with Caption</h3>
<table>
<caption>Annual Sales Report 2024</caption>
<thead>
<tr>
<th>Quarter</th>
<th>Revenue</th>
<th>Growth</th>
</tr>
</thead>
<tbody>
<tr>
<td>Q1</td>
<td>$250,000</td>
<td>5%</td>
</tr>
<tr>
<td>Q2</td>
<td>$280,000</td>
<td>12%</td>
</tr>
<tr>
<td>Q3</td>
<td>$315,000</td>
<td>15%</td>
</tr>
<tr>
<td>Q4</td>
<td>$340,000</td>
<td>8%</td>
</tr>
</tbody>
</table>Loading preview...
Default position - caption appears above table
caption {
caption-side: top;
}Caption appears below table
caption {
caption-side: bottom;
}Captions positioned at top and bottom
<h3>Styled Caption Examples</h3>
<table class="table-bottom">
<caption class="caption-bottom">Table 1: Student Performance (Bottom Caption)</caption>
<thead>
<tr>
<th>Student</th>
<th>Math</th>
<th>Science</th>
</tr>
</thead>
<tbody>
<tr>
<td>Alice</td>
<td>95</td>
<td>92</td>
</tr>
<tr>
<td>Bob</td>
<td>87</td>
<td>89</td>
</tr>
</tbody>
</table>
<table class="table-top">
<caption class="caption-top">Table 2: Monthly Sales (Top Caption)</caption>
<thead>
<tr>
<th>Month</th>
<th>Sales</th>
<th>Target</th>
</tr>
</thead>
<tbody>
<tr>
<td>January</td>
<td>$15,000</td>
<td>$12,000</td>
</tr>
<tr>
<td>February</td>
<td>$18,000</td>
<td>$15,000</td>
</tr>
</tbody>
</table>Loading preview...
Clearly state what the table contains
✓ "Monthly Sales Report 2024"Use clear, short language
✓ "Employee Performance Metrics"Mention time period or department if relevant
✓ "Q1 2024 Customer Feedback"Match caption style across tables
✓ Title-cased and descriptiveGood captions include both a title and optional description. You can use HTML elements within captions to format them.
<caption>
<strong>2024 Financial Summary</strong><br>
<small>Revenue and expenses by department</small>
</caption>Table with structured caption and scope attributes
<h3>Accessible Table with Caption</h3>
<table>
<caption>
<strong>Q1 2024 Financial Summary</strong><br>
<small>Revenue and expenses breakdown by department</small>
</caption>
<thead>
<tr>
<th scope="col">Department</th>
<th scope="col">Revenue</th>
<th scope="col">Expenses</th>
<th scope="col">Net</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Sales</th>
<td>$500,000</td>
<td>$150,000</td>
<td>$350,000</td>
</tr>
<tr>
<th scope="row">Marketing</th>
<td>$300,000</td>
<td>$200,000</td>
<td>$100,000</td>
</tr>
<tr>
<th scope="row">Operations</th>
<td>$200,000</td>
<td>$180,000</td>
<td>$20,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<th scope="row">Total</th>
<td>$1,000,000</td>
<td>$530,000</td>
<td>$470,000</td>
</tr>
</tfoot>
</table>Loading preview...
Financial or sales reports
Class timetables, events
Statistical information
Product specifications
Side-by-side features
Survey or test data