Is it acceptable to use tables for forms? Or is it still more correct to use divs?

后端 未结 13 1705
逝去的感伤
逝去的感伤 2020-12-02 22:55

I\'m wondering whether it\'s acceptable to use tables for forms.

Strictly speaking, name/value pairs are tabular data, aren\'t they? And a form is just

13条回答
  •  生来不讨喜
    2020-12-02 23:33

    Some people will say yes, some no.

    Here's a way for you to decide: If it truly contains tabular data, then it should, at least according to WCAG, have a summary attribute. The summary attribute should describe the purpose and structure of the table for the benefit of screen reader users. Can you write such an attribute? If so, then you should do so, and include it on your table. If you can't, then it probably isn't a really a table and you should look for another way of laying out your form.

提交回复
热议问题