How to Use Table Captions in HTML: A Complete Guide
☰Fullscreen
Table of Content:
The HTML <caption> element represents the title of a table.
Your table may shows results for a scientific experiment, values of stocks in a particular market, or what is on television tonight or it may be the informstion of students, each table should have a caption (about table) so that visitors to your site know what the table is for.
it is good practice to give the table a formal caption using the <caption> element.
The <caption> element appears directly after the opening <table> tag; it should come before the first row:
Syntax
<table> <caption> Opening hours for the Example Cafe </caption> <tr> ............................ ............................ </tr> </table>
html code
| Language | Type |
| C Programming | Structured |
| Java | Object Oriented |
| Php | Object Oriented |
| Python | Object Oriented |
Live Preview
Example of rowspan and colspan
Html code: rowspan
Spanning Rows Using the rowspan Attribute
Live Preview
Html code: colspan
Spanning Columns Using the colspan Attribute
Live Preview