Go to main content
Bypass navigation bar HTML Reference HTML Tags HTML Tutorials
Bypass language selection
Bypass location bar

Location: Home > HTML Tutorials > Tables in HTML > Page 5

Bypass main content

Tables in HTML (page 5)

Pages:<12345
Bypass main content

A table's caption

The caption of a table, defined through the HTML caption element must describe briefly and precisely the nature of the table and is usually rendered somewhere near the table (it's position can be set using style sheets). Remember that the caption tag is only allowed right after the table start tag.

Code
<table>
<caption>Table's caption</caption>
<tr>
<td>Data 1</td>
<td>Data 2</td>
<td>Data 3</td>
</tr>
<tr>
<td>Data 4</td>
<td>Data 5</td>
<td>Data 6</td>
</tr>
</table>
View
Table's caption
Data 1 Data 2 Data 3
Data 4 Data 5 Data 6

Summaries

You can also add information about the nature of the table using the summary attribute defined in the HTML table tag. The value of this attribute is intended to describe the table's nature in a longer way than the caption, helping to better understand the content of the table.

Code
<table summary="This table shows the media temperature in the months of June, July and August in the city of London">
<caption>London temperature chart</caption>
<tr>
<th scope="col">June</th>
<th scope="col">July</th>
<th scope="col">August</th>
</tr>
<tr>
<td>60ºF</td>
<td>65ºF</td>
<td>62ºF</td>
</tr>
</table>
View
London temperature chart
June July August
60ºF 65ºF 62ºF
Pages:<12345

Diseño y desarrollo: Latitud29.com

Links and logos|Contact|Beyond HTML|Tools and resources|Sitemap|Webmaster|Donate