在html表中有一个动作按钮列的语义是正确的吗? [英] Is it semantically correct to have an action button column in an html table?
问题描述
在语义上是否有动作列? (可以是编辑,投票或其他)
如果是这样,动作文本应该放在标题单元格的实际列中的图标上,或者应该在每个单元格上重复的文本(以按钮或链接的形式)和标题单元格空白?解决方案
这会很好。
如果动作直接与表
和表
包含表格数据,那么这将很好。
我会在头部
中放置一个动作描述,然后放置一个图标或一个按钮
。
为了确保表
可以尽可能广泛地使用,确保
- 它保留其标签结构
- 列和行被明确标记
- 按钮被赋予
名称
,值
或alt
标签。
另外,我会说记住语义标记不是目标......它只是实现最佳产品的工具。在某些情况下,语义可能需要被征服以满足需要。
Say you have some tabular data you want to display, as well as allow the user to perform some action on a row.
Is that semantically correct to have an "action" column? (could be "edit", "vote", or whatever)
If so should the action text be in the header cell with an icon in the actual column, or should that text be repeated on each cell (in the form of a button or link) and the header cell blank?
I think this would be fine.
If the action directly relates to the table
and the table
contains tabular data, then this would be fine.
I would put a description of the action in the head
and then place an icon or a button
in the cells.
In order to make sure the table
can be used as widely as possible, make sure
- it retains its tab structure
- the columns and rows are plainly marked
- the buttons are given
names
,values
oralt
tags.
Also, I would say remember that semantic markup is not the goal... it is only a tool to achieve the best possible product. In some cases, semantics may need to be subjugated to need.
这篇关于在html表中有一个动作按钮列的语义是正确的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!