How to create table header in HTML?

WBOY
Release: 2023-09-07 18:29:04
forward
1488 people have browsed it

How to create table header in HTML?

Use the tag in HTML to create the header. The tag in HTML is used to add headers to tables. Thead tag is used together with the tbody tag and tfoot tag to identify each part of the table (header, footer, table body).

The tag in HTML also supports the following additional attributes:

##alignrightcharcharactercharoffpixels or %valigntop
Attribute

Value

Description

left

center

justify

char

Deprecated− OK Visual alignment.

Deprecated − Specifies the characters to align text. Used when align = "char".

has Deprecated− Specifies the alignment offset (expressed as a pixel or percentage value) from the first character specified by the char attribute. Used when align = "char".

middle

bottom

baseline

#DEPRECATED− Vertical alignment.

Example

You can try running the following code to learn how to implement the

tag in HTML:

<!DOCTYPE html>
<html>
   <head>
      <title>HTML thead Tag</title>
   </head>
   <body>
      <table style = "width:100%" border = "1">
         <thead>
            <tr>
               <td colspan = "4">This is the head of the table</td>
            </tr>
         </thead>
         <tfoot>
            <tr>
               <td colspan = "4">This is the foot of the table</td>
            </tr>
         </tfoot>
         <tbody>
            <tr>
               <td>Cell 1</td>
               <td>Cell 2</td>
               <td>Cell 3</td>
               <td>Cell 4</td>
            </tr>
            <tr>
            ...more rows here containing four cells...
            </tr>
         </tbody>
     
         <tbody>
            <tr>
               <td>Cell 1</td>
               <td>Cell 2</td>
               <td>Cell 3</td>
               <td>Cell 4</td>
            </tr>
            <tr>
            ...more rows here containing four cells...
            </tr>
         </tbody>
      </table>
   </body>
</html>
Copy after login

The above is the detailed content of How to create table header in HTML?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!