Last Updated on April 26, 2023 by Roshan Parihar
HTML caption tag is used to show the title of the tables inside web pages.
This caption tag must be inserted just after table tag to show the title of the tables.
Syntax
1 |
<caption>Enter text here for table title</caption> |
1 2 3 4 5 6 7 8 9 10 11 |
<table border="1"> <caption>Human Fabric Names</caption> <tr> <th>Name of Fabric</th> <th>Description</th> </tr> <tr> <td>Cotton</td> <td>The cotton is used to create human relateed clothes</td> </tr> </table> |
Output
Name of Fabric | Description |
---|---|
Cotton | The cotton is used to create human relateed clothes |
Resources and References of HTML caption tag
1. W3C Specification.
2. HTML living standard
3. W3C project using Github