HTML tags

The tag defines a table header cell in an HTML table.

HTML tables have two cell types:

  • Header cell – contains header information (defined byElement creation)
  • Standard cells – Contain data (created by elements)

The text in the element is usually bold and centered.

The text in the element is usually plain left-justified text.

HTML Tag usage

A simple HTML table with two header cells and two data cells:

<table border="1">
    <tr>
        <th>Month</th>
        <th>Savings</th>
    </tr>
    <tr>
        <td>January</td>
        <td>$100</td>
    </tr>
</table>Copy the code

HTML Label the demonstration

Month Savings
January The $100

Browser support

All major browsers support tags.

Matters needing attention

If you need to span multiple rows or columns, use the colSPAN and RowSPAN properties!

Differences between HTML4 and HTML5

Some attributes in HTML4 are no longer supported in HTML 5.

attribute

attribute

value

describe

abbr

text

HTML5 is not supported. Specifies the abbreviated version of the content in the header cell.

align

left

right

center

justify

char
HTML5 is not supported. Specifies the horizontal alignment of header cell contents.

axis

category_name

HTML5 is not supported. Classify table header cells.

bgcolor rgb(x,x,x)

#xxxxxx

colorname

HTML5 is not supported. HTML4 is deprecated. Specifies the background color of the table header cell.

char

character

HTML5 is not supported. Specifies by which character the content is aligned.

charoff number

HTML5 is not supported. Specifies the offset of the aligned character.

colspan number

Specifies the number of columns that a table header cell can span.

headers header_id

Specifies one or more table header cells associated with a table header cell.

height

pixels

%

HTML5 is not supported. HTML4 is deprecated. Specifies the height of a table header cell.

nowrap

nowrap

HTML5 is not supported. HTML4 is deprecated. Specifies whether the contents of a table header cell are folded.
rowspan number

Specifies the number of rows that a table header cell can span.

scope

col

colgroup

row

rowgroup

Specifies whether a table header cell is a row, column, row group, or the head of a column group.

valign

top

middle

bottom

baseline

HTML5 is not supported. Specifies the vertical arrangement of table header cell contents.

width

pixels

%

HTML5 is not supported. HTML4 is deprecated. Specifies the width of the table header cell.

Global properties

The tag supports HTML global attributes.

Event attributes

The tag supports all HTML event attributes.

This document refers to the HTML Chinese help document