您好,欢迎访问一九零五行业门户网

在HTML中如何创建表头?

使用html中的标签来创建表头。html中的标签用于向表格添加表头。thead标签与tbody标签和tfoot标签一起用于确定表格的每个部分(表头、表尾、表体)。html中的标签还支持以下附加属性:属性

描述
align
rightleft
center
justify
char
已弃用− 可视对齐。
char
character
已弃用− 指定要对齐文本的字符。当align = char时使用。
charoff
pixels or %
已弃用− 指定与char属性指定的第一个字符的对齐偏移量(以像素或百分比值表示)。当align = char时使用。
valign
topmiddle
bottom
baseline
已弃用− 垂直对齐。
示例您可以尝试运行以下代码来学习如何在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>
以上就是在html中如何创建表头?的详细内容。
其它类似信息

推荐信息