Caption HTML

HTML <caption> Tag

To add a caption or a title to a table in HTML, the HTML <caption> tag is used. It is placed just after the <table> start tag and inside the <table> element. Usually, there is only one <caption> element is present in an HTML table.


<caption>Title of Table</caption>


<!DOCTYPE html>
table, th, td {
  border: 2px solid brown;
<table width="400">
  <caption>Students Details</caption>
    <td>Yash Panwar</td>
    <td>Janny Singh</td>
    <td>Ankita Das</td>


In the above example, we are creating a table in HTML and then adding a caption to it using the HTML <caption> tag.

Tag specific Attributes:

Attribute Value Uses
align top




To specify the alignment of a caption with respect to the table.

Global Attributes:

The HTML global attributes are supported by the HTML <caption> tag.

Event Attributes:

The HTML event attributes are supported by the HTML <caption> tag.

Supporting Browsers:

Chrome, IE, Firefox, Opera, and Safari.