Add table caption to a table in HTML and CSS

Description

The following code shows how to add table caption to a table.

Example


<!DOCTYPE HTML>
<html>
<body>
<table>
<caption>My Caption</caption>
<tr>
<td>100</td>
<td>200</td>
<td>300</td>
</tr><!--from   w ww .  j av  a  2s .  com-->
<tr>
<td>400</td>
<td>500</td>
<td>600</td>
</tr>
</table>
</body>
</html>

Click to view the demo

The code above generates the following result.

Add table caption to a table in HTML and CSS
Home »
  HTML CSS Tutorial »
    Table »
      Table Structure
HTML CSS Tutorial Table Structure
Add table caption to a table in HTML and CS...
Add table cell(table data) to a table in HT...
Add table footer to a table in HTML and CSS
Add table header to a table in HTML and CSS
Add vertical header or row header to a tabl...
Column groups with col element in HTML and ...
Create a Table with Longer Cell Content in ...
Create a nested table in HTML and CSS
Create a table with columns and rows in HTM...
Float table around text in HTML and CSS
Group column using colgroup in HTML and CSS
Span Cell to two rows in HTML and CSS
Span a table cell to Multiple Columns in HT...