📜  HTML th标签

📅  最后修改于: 2020-11-04 00:46:45             🧑  作者: Mango

HTML标签

在HTML表中,有两种类型的单元格:

  • 标题单元格-包含标题信息(使用元素创建)
  • 数据单元格-包含表的主要数据(使用元素创建)。

HTML标签用于定义HTML表的标题单元格。标题单元格默认显示为粗体并且在浏览器中居中,但是您可以使用CSS属性更改其默认样式。

标签必须用作的子元素内的元素

元件。表格的大小可以根据内容大小自动调整。

句法

    

以下是有关HTML的一些规范

Content....... 标签

Display None
Start tag/End tag Both Start and End tag
Usage HTML Tables




    HTML th Tag
    


 

Example of th tag

Month Date
January 20.01.2018
February 01.02.2018
March 15.03.2018

输出:

属性:

特定于标签的属性:

Attribute Value Description
abbr text It defines the abbreviated version of content of the header cell. (Not Supported in HTML5)
align left
right
center
justify
char
It specifies the alignment of the content of the header cell. (Not Supported in HTML5)
axis category_name It Categorizes header Cells(Not Supported in HTML5)
bgcolor rgb(x,x,x)
#xxxxxx
Color_name
It sets the background color of the header cell. (Not Supported in HTML5)
char character It specifies the alignment of the content of the header cell to the character. (Not Supported in HTML5)
charoff number It specifies the number of characters the header cell content will be aligned from the character specified by the char attribute. (Not Supported in HTML5)
colspan number It determines the number of columns a header cell should span.
headers header_id It determines a space-separated list of header cells which contains information of the cells is related.
height %
pixels
It determines the height of a table header cell. (Not Supported in HTML5)
nowrap nowrap If it sets then content inside the header cell should not wrap. (Not Supported in HTML5)
rowspan number It determines the number of rows a cell should span.
scope col
colgroup
row
rowgroup
It specifies the cells that the header element relates to. (Not Supported in HTML5)
valign top
middle
bottom
baseline
It determines the vertical alignment of the cell content. (Not Supported in HTML5)
width %
pixels
It determines the width of the header cell.(Not Supported in HTML5)

全局属性:

标签支持HTML中的Global属性。

事件属性:

标签支持HTML中的事件属性。

支持的浏览器

Element chrome browser Chrome ie browser IE firefox browser Firefox opera browser Opera safari browser Safari
Yes Yes Yes Yes Yes