table Header informationHeader information.."."/> table Header informationHeader information..".">

Home  >  Article  >  Web Front-end  >  How to add a table header in html

How to add a table header in html

青灯夜游
青灯夜游Original
2021-07-01 14:31:157907browse

In an HTML table, you can add a header by using one or more "th" tags in the table tag. The th tag is used to define the header cell in the HTML table; the syntax "

..
Header information Header information
".

How to add a table header in html

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

htmlAdd a header

<table border="1">
  <tr>
    <th>月份</th>
    <th>存款</th>
  </tr>
  <tr>
    <td>一月</td>
    <td>3000 元</td>
  </tr>
  <tr>
    <td>二月</td>
    <td>2000 元</td>
  </tr>
</table>

Rendering:

How to add a table header in html

Description:

tag defines the header cell in the HTML table. Header cell - Contains header information. Text within the

element is usually rendered bold and centered. bgcolorcharcharoffcolspanSpecifies the number of columns that the header cell can span. headersSpecifies one or more header cells associated with the header cell. heightnowrapnowraprowspanSpecifies the number of rows that the header cell can span. scopecolSpecifies whether the header cell is a row, column, or row The head of a group or column group. valigntopwidth##HTML5 Not supported. HTML 4.01 is deprecated. Recommended tutorial: "
Attribute Value Description
abbr text HTML5 is not supported. Specifies an abbreviated version of the contents in the header cell.
align left
#right
center
justify
char
HTML5 Not supported. Specifies the horizontal alignment of header cell contents.
axis category_name ##HTML5 Not supported. Classify header cells.
rgb(x,x,x)#xxxxxx
colorname
HTML5 Not supported. HTML 4.01 is deprecated. Specifies the background color of the header cell.
character HTML5 Not supported. Specifies which character should be used to align content.
number HTML5 Not supported. Specifies the offset of the alignment character.
number
header_id
pixels %
HTML5 is not supported. HTML 4.01 is deprecated. Specifies the height of the header cell.
HTML5 is not supported. HTML 4.01 is deprecated. Specifies whether the content in the header cell should be wrapped.
number
colgroup
row
rowgroup
middle
bottom
baseline
HTML5 is not supported. Specifies the vertical arrangement of header cell contents.
pixels%
Specifies the width of the header cell.
html video tutorial

"

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

Statement:
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