在表格内进行导航的语义方式?
我拥有本质上是表格数据的内容 - 产品列表。目前,我将其标记为table
,顶部有一个thead
,其中包含列的描述,tbody
包含实际的内容。内容。
现在的问题是,当您单击某个产品时,它会展开,并在下面出现一行,其中包含各种链接,例如“重命名”、“删除”等。
有没有语义上合理的方法来做到这一点?对我来说,在 tr 内放置除 th 和 td 之外的任何内容(而且根据规范可能甚至不允许)并添加单独的行,这是没有意义的菜单也不是最佳的。
I have what is essentially tabular data - a list of products. Currently, I have this marked up as a table
, with a thead
on top which contains a description of the column and tbody
which contains the actual content.
Now, the problem is that when you click on a product, it expands and a row appears underneath with various links such as "rename", "delete" and so on.
Is there a semantically sound way of doing that? It doesn't make sense to me to put anything but th and td
inside of tr
s (and it's probably not even allowed as per the spec) and adding a separate row for the menu is not optimal either.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从语义上讲,产品列表就是一个列表。
使用 ul 或 ol 而不是表格。
Semantically, a list of products is a list.
Use a ul or ol instead of a table.
如果您想使用语义方法,请不要在这种情况下使用表。
If you want to use a semantic approach, don't use tables in this situation.