html 表格:thead vs th [英] html tables: thead vs th

查看:22
本文介绍了html 表格:thead vs th的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来(无论如何,根据此页面上的示例)如果您正在使用 THEAD,您不需要使用 TH.

It looks like (according to the examples on this page, anyways) that if you're using THEAD, you don't need to use TH.

这是真的吗?如果是这样,THEAD 与 TH 的优缺点是什么?

Is that true? If so, what are the advantages/disadvantages of THEAD vs TH?

推荐答案

标签用于对 HTML 表格中的标题内容进行分组.thead 元素应该与 tbodytfoot 元素结合使用.

The <thead> tag is used to group the header content in an HTML table. The thead element should be used in conjunction with the tbody and tfoot elements.

更多:thead

您使用 来封装整行(或多行)以将它们指定为表头.根据规范,

You use <thead> to encapsulate an entire row (or rows) to designate them as the Table Header. According to the spec,

"这个划分使用户代理能够支持滚动表格主体独立于桌头和脚.打印长表时,表头脚信息可以在每一页上重复包含表数据."

"This division enables user agents to support scrolling of table bodies independently of the table head and foot. When long tables are printed, the table head and foot information may be repeated on each page that contains table data."

,另一方面,用于将特定单元格设置为标题单元格而不是普通的数据单元格.

<th>, on the other hand, is used to style a specific cell as a header cell rather than an ordinary data cell.

这篇关于html 表格:thead vs th的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆