HTML 5 thead Tag, Example of <thead> tag in html5


 

HTML 5 thead Tag, Example of <thead> tag in html5

In this discussion, We will introduce about the use of <thead> tag in html5. This tag is used to specify the group of header of the table body.

In this discussion, We will introduce about the use of <thead> tag in html5. This tag is used to specify the group of header of the table body.

HTML 5 <thead> Tag, Example of <thead> tag in html5

In this discussion, We will introduce about the use of <thead> tag in html5. This tag is used to specify the group of header of the table body. In the table we must have zero or more <tr> tag inside the <thead> tag. The <thead> tag is used in conjunction with <tbody>, <tfoot> in the <table> tag. The <thead> tag must have one or more <th> tag within <tr> tag which is nested in <thead>. The <thead> tag is the child of <table> tag and used after the <caption>, <colgroup> tag. This tag must have opening and closing tags.

Declaration Syntax:

the syntax of the <thead> tag is as:

<thead>One or more tr, th tag</thead>

This tag don't have any specific attribute.

Example: thead_tag.html.

<!DOCTYPE html>
<html>
<head>
<title>Example of thead tag</title>
</head>
  <body>
    <table border="1">
                <thead>
                    <tr>
                       <th>NAME</th>
                       <th>Sr. name</th>
                   </tr>
             </thead>
                   <tr>
                     <td> Gyan</td>
                     <td>  Singh</td>
                  </tr>
                  <tr>
                     <td> Ankit</td>
                     <td> Kumar</td>
                </tr>
     </table>
  </body> 
</html>

Output:

Download This Example:

Difference between html4.01 and html5.

None

Ads