• Skip to primary navigation
  • Skip to main content

Tech Honey

The #1 Website for Oracle PL/SQL, OA Framework and HTML

  • Home
  • HTML
    • Tags in HTML
    • HTML Attributes
  • OA Framework
    • Item in OAF
    • Regions in OAF
    • General OAF Topics
  • Oracle
    • statement
    • function
    • clause
    • plsql
    • sql
You are here: Home / HTML / Tags / HTML Caption Tag

HTML Caption Tag

August 8, 2013 by techhoneyadmin

HTML Caption TagHTML Caption Tag <caption> is used to provide a caption to a table in HTML 5. The HTML Caption Tag must be places just after the HTML Table Tag.

Only one Caption is allowed per table in an HTML webpage. The caption of a table is aligned as center by default by HTML Caption Tag.

Caption Tag align attribute is removed in HTML 5 and is deprecated in HTML 4.01. Caption tag is a closed tag and needs closing Caption Tag </caption>


HTML Caption Tag Syntax

<table>
<caption> Table Caption Goes Here </caption>
Table rows and data goes here..
</table>

HTML Caption Tag Attributes

HTML Caption Tag Attribute Value Description
align left, right, top, bottom Specifies the alignment of the caption of table in HTML. Not Supported in HTML 5.

HTML Caption Tag supports all HTML Global Attributes and HTML Event Attributes.


HTML Caption Tag Example

HTML Caption Tag Code Output
</pre>
<table border="1"><caption>Top 3 Ranks are</caption>
<tbody>
<tr>
<th>Rank</th>
<th>Name</th>
</tr>
<tr>
<td>John</td>
<td>1</td>
</tr>
<tr>
<td>Jack</td>
<td>2</td>
</tr>
<tr>
<td>Jill</td>
<td>3</td>
</tr>
</tbody>
</table>
<pre>
Top 3 Ranks are
Rank Name
John 1
Jack 2
Jill 3

The above HTML Caption Tag example shows that by default the caption of the table is aligned at center of table.


HTML Caption Tag Supporting Browser

S. No. Browser Supported(Yes/No)
1 Internet Explorer Yes
2 Firefox Yes
3 Google Chrome Yes
4 Opera Yes
5 Safari Yes

Filed Under: Tags Tagged With: Caption HTML, Caption HTML Tag, Caption Tag HTML, HTML Caption Tag, HTML Caption Tag Syntax and Examples, HTML Code for Caption Tag, HTML Table caption, HTML Tag Caption, HTMLCaptionTag, Tag Caption HTML, Tag HTML Caption, Using HTML Caption Tag, What is the use of HTML Caption Tag

Copyright © 2023 · Parallax Pro on Genesis Framework · WordPress · Log in