【发布时间】:2020-10-26 16:51:46
【问题描述】:
我正在尝试编写一个脚本,将旧网站中过时的 HTML 转换为有效的 HTML5,但我正在努力寻找轴属性的替代品。
td 和 th 元素上的 axis 属性显然是为了 set a category on table's (header) cells。
根据https://dev.w3.org/html5/pf-summary/obsolete.html,应该换成scope属性。
但是,the scope attribute tells wether that the th element is a header for a cell or a column,但它不会在 table 元素上放置类别。此外,在td 元素上使用scope 属性已过时,它只能用于th。
那么如何替换axis属性呢?
【问题讨论】:
-
我不知道有任何客户端软件对
axis属性做了任何有用的事情,因此您可以将其替换为任何内容。这读起来像XY problem:您实际上想在这里实现什么?如果您可以使用axis,您希望它用于什么用途和用途? -
已编辑,所以也许我可以删除它,这样会好吗?