在html表中有一个动作按钮列的语义是正确的吗? [英] Is it semantically correct to have an action button column in an html table?

查看:84
本文介绍了在html表中有一个动作按钮列的语义是正确的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设你有一些你想要显示的表格数据,并且允许用户在一行上执行一些操作。

在语义上是否有动作列? (可以是编辑,投票或其他)

如果是这样,动作文本应该放在标题单元格的实际列中的图标上,或者应该在每个单元格上重复的文本(以按钮或链接的形式)和标题单元格空白?解决方案

这会很好。



如果动作直接与包含表格数据,那么这将很好。



我会在头部中放置一个动作描述,然后放置一个图标或一个按钮



为了确保可以尽可能广泛地使用,确保


  1. 它保留其标签结构

  2. 列和行被明确标记

  3. 按钮被赋予名称 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

  1. it retains its tab structure
  2. the columns and rows are plainly marked
  3. the buttons are given names, values or alt 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屋!

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