gpt4 book ai didi

html - 添加显示 : table-* to the CSS specification? 的可验证原因是什么

转载 作者:搜寻专家 更新时间:2023-10-31 23:00:28 25 4
gpt4 key购买 nike

我知道一些布局更容易实现,因为 display: table-* 对我们在 CSS 中可用(例如 Holy Grail layout ),但决定添加的背后原因是什么这些显示选项到 CSS standard ,鉴于众所周知的历史仇恨,HTML 中基于表格的布局。

任何对讨论、邮件列表条目、规范等的引用都会很棒!

我不是在寻找使用这些选项的理由,也不是在寻找关于标准机构动机的意见/猜测。而是,为什么以及由谁决定将其纳入标准有功劳。

谢谢。

最佳答案

问题不是基于表格的布局不好,而是表格被用于布局。这种情况使得很难确定哪些是实际表格(即表格数据),哪些是仅用于布局的表格。

将 table-* 添加到 CSS 意味着我们可以将基于布局的 table-* 移动到 CSS 并仅保留 HTML 中的语义表(即实际表格数据)


这是我在 W3 邮件文件中找到的最早的引用资料 - https://lists.w3.org/Archives/Public/www-style/1998Aug/0091.html . (“显示:表格”作为 TABLE 布局的替代品)

有一个对旧线程的引用,您可以一直追溯到它,但上面提供了足够的上下文。节选

There are a lot of pages out there where blocks of content are arranged for visual purposes using HTML tables. This structure is supposed to be deprecated in HTML 4.0, but in practice it is difficult to work out the corresponding CSS construct, especially if the TABLE-based layout was unconcerned with the precise width of the cells.

However, in the CSS2 spec http://www.w3.org/TR/REC-CSS2/visuren.html#value-inst-table, the following are listed as possible values for the 'display' property:

table, inline-table, table-row-group, table-column,
table-column-group, table-header-group, table-footer-group, table-row, table-cell, and table-caption

关于html - 添加显示 : table-* to the CSS specification? 的可验证原因是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31806523/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com