表格何时适用,何时不适合? [英] When are tables appropriate, and when are they not?

查看:77
本文介绍了表格何时适用,何时不适合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我理解表格应该用于表格数据的问题和

不是布局,但我想澄清一下究竟是什么

构成表格数据。


例如,如果我有一个表格,用户需要在其中填写

各种信息,然后用桌子布置,这很容易。

一个基本的例子......

http://www.kidsinaction.org.uk/TableForm.html


[请注意,这是一个非常基本的快速示例,用于说明

的目的。在一个真实的例子中,应该做更多的努力来确保它是可访问的,通过使用标签标签,轴和枢轴

属性等等。为简洁起见,这一切都被省略了。和清晰度]


这个(ab)使用表的主要优点是单元格

自动在水平和垂直方向排列。


这可以在CSS中完成吗?我知道我可以单独处理每一行,并且

使用div,但是我如何得到第二列(条目

盒子)排队?使用表格允许浏览器(或者正在使用的任何

渲染设备)决定给每个

行和列提供多少空间以允许内容适合。所有的输入框在表格中垂直排列




更重要的是,这实际上是滥用表格吗?我在这里读了一个帖子

,有人建议这是合理的。

有人建议这是一种表格数据。没有人认为

,这似乎是一个公平的建议。


有何评论?这是一个真正的问题,不是为了哄骗或

开始争论。我真的不确定这是否滥用桌子和

想听听专家的意见。如果是滥用,是否有一个明智而简单的CSS替代方案? TIA


-

Alan Silver

(此行下方添加的任何内容都与我无关)

Hello,

I understand the issue that tables should be used for tabular data and
not for layout, but I would like some clarification as to exactly what
constitutes tabular data.

For example, if I have a form, in which the user is required to fill in
various bits of information, then laying out with a table makes it easy.
A basic example...

http://www.kidsinaction.org.uk/TableForm.html

[Please note that this is a very basic quick example knocked up for the
purpose of illustration. In a real example, more effort should be made
to ensure it is accessible, by using label tags, axis and pivot
attributes, etc. This was all omitted for brevity and clarity]

The main advantage of this (ab)use of tables is that the cells
automatically line up both horizontally and vertically.

Can this be done in CSS? I know I could treat each row individually, and
use a div, but then how would I get the second column (with the entry
boxes in) to line up? Using a table allows the browser (or whatever
rendering device is being used) to decide how much space to give each
row and column to allow the contents to fit. All the entry boxes line up
vertically in the table.

More to the point, is this actually an abuse of tables? I read a thread
here a while back in which someone suggested that this was reasonable.
It was suggested that this was a form of tabular data. No-one argued
with that, and it seemed a fair suggestion.

Any comments? This is a genuine question, not an intention to troll or
start an argument. I''m really not sure if this is an abuse of tables and
would like to hear the experts'' opinion. If it is an abuse, is there a
sensible and simple CSS alternative? TIA

--
Alan Silver
(anything added below this line is nothing to do with me)

推荐答案

Alan Silver写道:


[用于显示表格的表格]
Alan Silver wrote:

[table used to display form]
更重要的是,这实际上是滥用表格吗?我在这里读了一个帖子,其中有人建议这是合理的。
有人建议这是表格数据的一种形式。没人提出这个问题,这似乎是一个公平的建议。
More to the point, is this actually an abuse of tables? I read a thread
here a while back in which someone suggested that this was reasonable.
It was suggested that this was a form of tabular data. No-one argued
with that, and it seemed a fair suggestion.




我的意见从那以后没有改变;-) - 我用表表格。


-

Els http://locusmeus.com/

无障碍网页设计: http://locusoptimus.com/


Alan Silver写道:
Alan Silver wrote :
你好,

我理解表格应该用于表格数据而不是布局的问题,但是我想澄清一下究竟是什么构成表格数据。

例如,如果我有一个表格,用户需要在其中填写各种信息,然后用桌子布置使其​​变得简单。
一个基本的例子......
http://www.kidsinaction.org.uk/TableForm.html

[请注意,这是一个非常基本的快速示例为了说明的目的。在一个真实的例子中,应该做更多的努力以确保它是可访问的,通过使用标签标签,轴和枢轴
属性等。为简洁和清晰,这些都被省略了]


感谢您的解释。我正要提到你缺少标签:)

这个(ab)使用表格的主要优点是单元格可以自动在水平和垂直方向排列。


它们水平排列。任何块级元素都会垂直排列那些

元素。


第17.4.2节示例包含INPUT控件的表单
http://www.w3.org/TR/html401/interac....html#h-17.4.2


这可以在CSS中完成吗?


可能。我想是的,是的。

我知道我可以单独处理每一行,然后使用div,但是我怎样才能得到第二列(带有条目
框)到行吗?使用表格允许浏览器(或任何正在使用的渲染设备)决定为每个
行和列提供多少空间以允许内容适合。所有的输入框在表格中垂直排列。

更重要的是,这实际上是滥用表格吗?


不,我不会说虐待。表格(如订阅表格)通常是用表格格式化的。什么对我来说绝对无稽之谈

- 使用嵌套表格

- 使用表格来表示远离表格数据的任何内容

- 使用表格与各种spacer.gifs,几十个& nbsp; for

水平填充,数十个< br>垂直通风
- 看到有10,30或50张桌子的页面


例如就在今天, http://www.yahoo.com/ 正门页面正好

* _87嵌套表_ *。有些日子,yahoo.com有超过100个表,有60个

嵌套表。

我在这里读了一个帖子,有人认为这是合理的。
有何评论?这是一个真实的问题,


没关系。它被称为讨论新闻组。 :)


并非打算转向或开始争论。我真的不确定这是不是滥用桌子而且
想听专家的意见。如果是滥用,是否有一个明智而简单的CSS替代方案? TIA
Hello,

I understand the issue that tables should be used for tabular data and
not for layout, but I would like some clarification as to exactly what
constitutes tabular data.

For example, if I have a form, in which the user is required to fill in
various bits of information, then laying out with a table makes it easy.
A basic example...

http://www.kidsinaction.org.uk/TableForm.html

[Please note that this is a very basic quick example knocked up for the
purpose of illustration. In a real example, more effort should be made
to ensure it is accessible, by using label tags, axis and pivot
attributes, etc. This was all omitted for brevity and clarity]
Thanks for expliciting this. I was about to mention your lack of labels :)

The main advantage of this (ab)use of tables is that the cells
automatically line up both horizontally and vertically.
They line up horizontally. Any block-level elements will line up those
elements vertically.

E.g.:
Example of section 17.4.2 Examples of forms containing INPUT controls
http://www.w3.org/TR/html401/interac....html#h-17.4.2

Can this be done in CSS?
Probably. I think so, yes.
I know I could treat each row individually, and use a div, but then how would I get the second column (with the entry
boxes in) to line up? Using a table allows the browser (or whatever
rendering device is being used) to decide how much space to give each
row and column to allow the contents to fit. All the entry boxes line up
vertically in the table.

More to the point, is this actually an abuse of tables?
No, I wouldn''t say abuse. Forms (like a subscription form) are often
formatted with tables. What''s absolutely nonsense to me is
- use of nested tables
- using table for nothing that is remotedly close to tabular data
- using table with all kinds of spacer.gifs, dozens of &nbsp; for
horizontal padding, dozens of <br> for vertical ventilation
- seeing a page that has 10, 30 or 50 tables

E.g. Just today, http://www.yahoo.com/ main entrance page has exactly
*_87 nested tables_*. Some days, yahoo.com has over 100 tables with 60
nested tables.
I read a thread here a while back in which someone suggested that this was reasonable.
It was suggested that this was a form of tabular data. No-one argued
with that, and it seemed a fair suggestion.

Any comments? This is a genuine question,
It''s ok. It''s called a discussion newsgroup. :)

not an intention to troll or start an argument. I''m really not sure if this is an abuse of tables and
would like to hear the experts'' opinion. If it is an abuse, is there a
sensible and simple CSS alternative? TIA




我相信你会在这个页面的链接中找到可能的CSS替代品:


基于表格网页设计与基于CSS的网页设计:资源,

解释和教程
http://www.gtalbot.org/NvuSection/Nv...CSSDesign.html

$ b $bGérard

-

删除等等给我发电子邮件



I''m sure you will find possible CSS alternatives in the links of this page:

Table-based webpage design versus CSS-based webpage design: resources,
explanations and tutorials
http://www.gtalbot.org/NvuSection/Nv...CSSDesign.html

Gérard
--
remove blah to email me


Sun,2006年2月5日14:40:46 +0000来自Alan Silver< ; alan-
si****@nospam.thanx.inva lid>:
Sun, 5 Feb 2006 14:40:46 +0000 from Alan Silver <alan-
si****@nospam.thanx.invalid>:
我理解表格应该用于表格数据而不是布局的问题,但我想澄清一下
构成表格数据的确切内容。

例如,如果我有一个表单,其中用户需要填写各种信息离开,然后用桌子布置,这很容易。
I understand the issue that tables should be used for tabular data and
not for layout, but I would like some clarification as to exactly what
constitutes tabular data.

For example, if I have a form, in which the user is required to fill in
various bits of information, then laying out with a table makes it easy.




一旦你将自己称为铺设,就会发出警报铃声

应该在你脑子里消失。这告诉你,你已经跳过了询问你的数据是否真的是表格的必要步骤。

特别是在表格的情况下,你可能会说明

字幕和填写(文本框或选项列表)逻辑上是b $ ba两列表,每个标题都与其填充相关联 - 在。但是如果你有任何没有标题的填写,那么

就会崩溃。


-

Stan Brown,Oak Road系统,美国纽约州汤普金斯县
http://OakRoadSystems.com/

HTML 4.01规范: http://www.w3 .org / TR / html401 /

验证人: http: //validator.w3.org/

CSS 2.1规范: http://www.w3.org/TR/CSS21/

验证器: http://jigsaw.w3.org/css-validator/

为什么我们不能帮助你:
http://diveintomark.org/archives/200 .. ._wont_help_你



As soon as you state it to yourself as "laying it out", alarm bells
should go off in your head. That tells you''re you''ve skipped over the
essential step of asking whether your data actually are tabular.
In the case of a form in particular, you might make a case that the
captions and the fill-ins (text boxes or option lists) are logically
a two-column table, with each caption tied to its fill-in. But that
breaks down if you have any fill-in without a caption.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won''t Help You:
http://diveintomark.org/archives/200..._wont_help_you


这篇关于表格何时适用,何时不适合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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