Home  >  Article  >  Web Front-end  >  How to create table title in HTML?

How to create table title in HTML?

WBOY
WBOYforward
2023-08-30 19:33:061819browse

How to create table title in HTML?

Create a title using the

tag in HTML. The tag in HTML is used to specify title cells or headers in tables.

The following are the attributes:

##abbrDEPRECATEDalignDEPRECATEDaxisDEPRECATED bgcolor#hexcode - Specifies the background color of the header cell. char - Specifies the characters to justify text. Used when align = "char". charoff - Specifies the alignment offset (expressed as a pixel or percentage value) relative to the first character specified by the char attribute. Used when align = "char". colspanheadersheight - Specifies the height of the header cell. nowrap - Prevent text from wrapping. rowspanscopecolgroupvalignmiddle - Vertical alignment. widthExampleYou can try running the following code to learn how to create table headers in HTML:
Attributes

Value

Description

##abbreviated_text

- Specifies an abbreviated version of the content in the header cell.

right

left

center

justify

char

- Alignment of content in header cells.

Name

- Specifies the category of this th.

##rgb(x,x,x)

colorname

DEPRECATED

Character

is deprecated

pixels or %

has been Deprecated

Number

Specify the span of the header cell Number of columns.

Id

Specify one or more with The header cell associated with the cell.

pixels

DEPRECATED

Nowrap

Deprecated

rowspan

Specifies the span of the header cell Rows.

col

row

rowgroup

This property is used for header cells, specifying the cells that will use the information for this header.

top

bottom

baseline

#DEPRECATED

pixels or %

## has been Deprecated

- Specifies the width of the header cell.

<!DOCTYPE html>
<html>
   <head>
      <style>
         table, th, td {
            border: 1px solid black;
         }
      </style>
   </head>
   <body>
      <h3>Result</h3>

      <table>
         <th>Marks</th>
         <th>Student</th>

         <tr>
            <td>600</td>
            <td>Amit</td>
         </tr>
         <tr>
            <td>400</td>
            <td>Anil</td>
         </tr>
      </table>

   </body>
</html>

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

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete