HTML HTML Tutorial HTML Forms HTML Graphics HTML Media HTML APIs HTML Tags



HTML Tag: thead

The HTML tag <thead> is used to define the header section of a table. It is used to group the header content in a table. The <thead> tag is used along with the <tbody> and <tfoot> tags to define the different parts of a table.

Brief Explanation about HTML Tag: thead

The <thead> tag is used to group the header content in a table. It is used to define the header section of a table. The <thead> tag is used along with the <tbody> and <tfoot> tags to define the different parts of a table.

The <thead> tag is used to group the header content in a table. It is used to define the header section of a table. The <thead> tag is used along with the <tbody> and <tfoot> tags to define the different parts of a table.

The <thead> tag is used to group the header content in a table. It is used to define the header section of a table. The <thead> tag is used along with the <tbody> and <tfoot> tags to define the different parts of a table.

Code Examples in HTML Tags

Here are some examples of how to use the <thead> tag in HTML:

Example 1:

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Age</th>
      <th>Gender</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>John</td>
      <td>25</td>
      <td>Male</td>
    </tr>
    <tr>
      <td>Jane</td>
      <td>30</td>
      <td>Female</td>
    </tr>
  </tbody>
</table>

Example 2:

<table>
  <thead>
    <tr>
      <th>Month</th>
      <th>Sales</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>January</td>
      <td>$1000</td>
    </tr>
    <tr>
      <td>February</td>
      <td>$1500</td>
    </tr>
  </tbody>
  <tfoot>
    <tr>
      <td>Total</td>
      <td>$2500</td>
    </tr>
  </tfoot>
</table>

Example 3:

<table>
  <thead>
    <tr>
      <th colspan="2">Personal Information</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Name</td>
      <td>John</td>
    </tr>
    <tr>
      <td>Age</td>
      <td>25</td>
    </tr>
    <tr>
      <td>Gender</td>
      <td>Male</td>
    </tr>
  </tbody>
</table>

References

Activity