# How do we include a table caption in HTML?

HTMLJavascriptProgramming Scripts

Use the <caption> tag to create a caption for a table. You can try to run the following code to include a table caption in HTML:

## Example

<!DOCTYPE html>
<html>
<style>
table, th, td {
border: 1px solid black;
}
</style>
<body>
<h2>Cricketers</h2>
<table style = "width:100%">
<caption>Indian Cricketers</caption>
<th>Name</th>
<tr>
<td>Sachin Tendulkar</td>
</tr>
<tr>
<td>Virat Kohli</td>
</tr>
</table>
</body>
</html>
Published on 13-Mar-2018 11:11:54