HTML <caption> Tag
The caption tag is used to specify the caption of a table. This tag will be inserted just after the <table> tag. Only one caption can be specified for one table. It is by default aligned to the center.
<caption align = "value" ></caption>
Attributes: This tag accepts a single attribute as mentioned above and described below.
- align: This attribute is used to specify the alignment of text content.
Below examples illustrate the <caption> tag in HTML:
Example 1: Adding a caption to the table i.e. by default aligned to the center.
Example 2: Adding a caption to the table and adding align attribute to it to align the caption to the left.
- Google Chrome
- Internet Explorer
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.