HTML <caption> Tag Last Updated : 11 Jul, 2025 Comments Improve Suggest changes 6 Likes Like Report The <caption> tag in HTML is used to provide a title or description for a <table> element. It helps give context or additional information about the content of the table.The <caption> tag must be placed immediately after the opening <table> tag.Useful for summarizing table data, especially in large datasetsThe <caption> tag also supports the Global Attributes and Event Attributes in HTML. html <html> <body> <table> <caption>Student Information</caption> <tr> <th>Name</th> <th>Age</th> </tr> <tr> <td>Alice</td> <td>20</td> </tr> <tr> <td>Bob</td> <td>22</td> </tr> </table> </body> </html> The <caption> tag provides a title for the table, which in this case is "Student Information".The table contains rows of data with names and ages.More Example for HTML caption TagEmployee Table with Caption Tag html <html> <body> <table> <caption>Employee Details</caption> <tr> <th>Employee Name</th> <th>Position</th> </tr> <tr> <td>John</td> <td>Manager</td> </tr> <tr> <td>Emma</td> <td>Developer</td> </tr> </table> </body> </html> In this Example:The <caption> tag provides a title for the employee details table.It helps to clarify the purpose of the table for screen readers and users.Product Table with Style HTML <html> <head> <style> table { width: 100%; border-collapse: collapse; } th, td { border: 1px solid black; padding: 10px; } caption { font-size: 1.5em; margin-bottom: 10px; } </style> </head> <body> <table> <caption>Product Details</caption> <tr> <th>Product Name</th> <th>Price</th> </tr> <tr> <td>Smartphone</td> <td>$599</td> </tr> <tr> <td>Laptop</td> <td>$999</td> </tr> </table> </body> </html> In this Example:The <caption> tag is used to label the table as "Product Details," making the content easily identifiable.Custom styles such as border and padding are applied to enhance readability and table structure.Best Practices for the HTML <caption> TagUse for Accessibility: Always include a <caption> tag when the table’s content needs a clear and descriptive title, improving accessibility for screen readers.Place Immediately After <table> Tag: Ensure the <caption> tag is the first child of the <table> element, right after the opening <table> tag, for proper structure and functionality. Create Quiz Comment M manaschhabra2 Follow 6 Improve M manaschhabra2 Follow 6 Improve Article Tags : Web Technologies HTML HTML-Tags Explore HTML BasicsHTML Introduction4 min readHTML Editors4 min readHTML Basics7 min readStructure & ElementsHTML Elements4 min readHTML Attributes7 min readHTML Headings3 min readHTML Paragraphs3 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks2 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables9 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms4 min readHTML5 Semantics5 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List5 min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like