HTML <caption> tag
When writing in HTML, the <caption> tag is a block element used to add a title to a table. It should be noted that if you are using the <caption> tag inside of a <table> tag that is the only element in a <figure>, use <figcaption> instead. The following sections contain information about the <caption> tag, including an example of it in use, as well as related attributes and browser compatibility.
Example of <capation> code
<table class="mtable2 tab">
<caption>I'm a Table Caption</caption>
</tr> <tr class="tcw">
As you can see in the previous example, there is a title above the table; it was put there using the <caption> tag. We have also used CSS to added classes to the table and its rows to make them look nicer.
Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The <caption> tag only has one unique attribute that became deprecated and the obsolete within HTML5. The following table shows that attribute, as well as a description of what it did.
|align||Designated the alignment of the table caption.|
|All versions||All versions||All versions||All version||All versions||All versions|