无tableless html替代 [英] Tableless html alternative
问题描述
有人可以给我一些html来布局以下不使用表格吗?
______________________________________
| _______ | _____________ | |
| _______ | _____________ | _______________ |
| _______ | _____________ | |
| _______ | _____________ | |
| _______ | _____________ | _______________ |
第三列需要跨越前两个行,然后跨接下三个
第一个列需要有相同的宽度
我问这是因为整个表格已死的布局参数
UPDATE:
标记的内容有复选框,文本框和textareas
结论: strong>
这非常有启发性。我相信我已经清楚了这个哲学问题。
在我看来,一般规则应该是:不要为整个网站使用表格,如果有部分看起来像表,然后使用表。 从不使用表的极端似乎不切实际和理论。同样,过多使用表会使维护变得困难,并且处理4层嵌套表可能是一个真正的痛苦。因为上面的布局看起来像一个表我要使用表。 :)
即使内容不是表格,也可以根据需要使用表格。大多数反对使用表格来布局的论据是纯粹的理论性的(例如,你是否真的计划为你的网站提供多个样式表?)你有时候,特别是在更大的布局问题一个网站,表的工作比CSS更好。
使用什么工作。
表经常滥用布局,并且它们中的大多数可以被废弃以支持更简单的CSS布局。但偶尔,表是更好的工具。
Can someone show me some html to layout the following not using tables?
______________________________________
|_______|_____________| |
|_______|_____________|_______________|
|_______|_____________| |
|_______|_____________| |
|_______|_____________|_______________|
The third column needs to span the first two "rows" and then span the next three "rows" The first "column" needs to have the same width
I ask this because of the whole "Tables are dead for layout" argument
UPDATE: the content of the markup has checkboxes, textboxes, and textareas
CONCLUSION:
This has been very enlightening. I believe I have been cleared up with this philosophical question.
It seems to me that the general rule should be: Don't use tables for your entire website, if there are sections that look like a table, then use a table. Extremes of "NEVER USE A TABLE" seems impractical and theoretical. Likewise, excessive use of tables makes maintenance difficult, and dealing with 4-deep nested tables can be a real pain.
So because the layout above "looks like a table" I'm going to use a table. :)
Even if the content isn't tabular, use a table if you need to. Most of the arguments against using a table for layout are purely theoretical (are you really planning on offering more than one stylesheet for your site, for example? Do you care how your form appears semantically?) Sometimes, especially in the larger layout issues for a site, tables work much better than CSS.
Use what works.
Tables were often abused for layout, and most of them can be scrapped in favor of a simpler CSS layout. but occasionally, tables are the better tool.
这篇关于无tableless html替代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!