Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

HTML thead Tag

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The <thead> tag in HTML is used to give a header to the group of content of the body. This tag is used in HTML tables as head and body which is known as thead and tbody.

Syntax: 

<thead>
// Table head Contents...
</thead>

Attributes: 

  • align: Set the alignment of the text content.
  • valign: Set the vertical alignment of the text content.
  • char: Set the alignment of content inside the <thead> element to a character.
  • charoff: It is used to sets the number of characters that will be aligned from the character specified by the char attribute. The value of these attributes is in numeric form.

Example: 

HTML




<!DOCTYPE html>
<html>
    <body>
        <center>
        <h1>GeeksforGeeks</h1>
        <h2>thead Tag</h2>
        <table>
             
            <!-- thead tag starts from here -->
            <thead>
                <tr>
                <th>Name</th>
                <th>User Id</th>
                </tr>
            </thead>
            <!-- thead tag ends here -->
             
            <tbody>
                <tr>
                <td>Ram</td>
                <td>@ram_b</td>
                </tr>
                <tr>
                <td>Shashank</td>
                <td>@shashankla</td>
                </tr>
            </tbody>
        </table>
        </center>
    </body>
</html>

Output: 

Supported Browsers:

  • Google Chrome 1 and above
  • Edge 12 and above
  • Firefox 1 and above
  • Internet Explorer
  • Safari
  • Opera

My Personal Notes arrow_drop_up
Last Updated : 01 Aug, 2022
Like Article
Save Article
Similar Reads