Spread the love

The HTML <caption> Tag is used to give the title of the HTML Table. It must be used within <table>
and only after the <table> Tag is turned on. The Table can only contain one <caption> element.

Example:-

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>
    HTML caption Tag
  </title>
</head>
<body>
<h1>This is  HTML caption Tag Example</h1>

<table border="1">
    <caption>COVID-9 FORM</caption>
    <thead>
        <tr>
            <th>No.</th>
            <th>Name</th>
            <td>Address</td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>1</td>
            <td>Khushal</td>
            <td>Naroda</td>
        </tr>
        <tr>
            <td>2</td>
            <td>Khushal Tank</td>
            <td>New Naroda</td>
        </tr>
    </tbody>
</table>

</body>
</html>

Output:-


Spread the love

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *