切勿使用表格进行布局。 [英] Never use tables for layout.

查看:58
本文介绍了切勿使用表格进行布局。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


切勿使用表格进行布局。
Never use tables for layout.



我主要指的是即使表格数据也不想要表格的人,但是因为你提出来了。

< a rel =nofollowhref =http://xhtml.com/en/xhtml/reference/table/#table-best-practicetarget =_ blank> http://xhtml.com/en/xhtml/参考/...-最佳实践

I was primarily referring to those that don''t want tables even for tabular data, but since you bring it up.

http://xhtml.com/en/xhtml/reference/...-best-practice


虽然不鼓励使用布局表,但是当没有等效的CSS构造时,有时必须使用它们是可用的(或流行的Web浏览器不支持)。
Although using layout tables is discouraged, they sometimes must be used when no equivalent CSS construct is available (or is not supported by popular Web browsers).

推荐答案


当没有等效的CSS构造可用时,有时必须使用它们(或流行的Web浏览器不支持)。
they sometimes must be used when no equivalent CSS construct is available (or is not supported by popular Web browsers).



我无视任何人命名这样的实例。

永远不要使用
布局表。



我无视任何人命名这样的实例。
I defy anyone to name such an instance.



我假设您接受表格对于表格数据是可以接受的。


好​​的,那么,有一个页面怎么样?容器顶部的命令的变量列表和容器左侧的另一个命令变量列表。您希望容器的宽度和高度适合内容而不是固定的高度/宽度,因此大字体可以使用大字体。和其他东西将正常工作。关键是你希望每个轴上的容器根据内容容器的大小调整大小。


< html>< head>< style>

table tr td {border:1px solid black;垂直对齐:顶部; }

< / style>< / head>< body>

< table style =" width:100%;">< tr> ;< td />< td> [command1] [command2] [command3] [command4] [command5] [command6] [command7]< / td>< / tr>

< TR>< TD>< UL><李> SUB1< /立GT;<李> SUB2< /立GT;<李> SUB3< /立GT;<李> SUB4< /立GT;< / ul>< / td>< td>这是内容的来源。这里放了很多内容。< / td>< / tr>< / table>

< / body>< / html>

I assume you accept that tables are okay for tabular data.

Okay, well, what about a page that has a variable list of commands on top a container and another variable list of commands to the left of a container. You want the width and height of the containers to fit the content rather than fixed height/width so "large fonts" and other stuff will work right. The key point is that you want a container on each axis to adjust size with the content container''s size.

<html><head><style>
table tr td { border:1px solid black; vertical-align:top; }
</style></head><body>
<table style="width:100%;"><tr><td /><td>[command1] [command2] [command3] [command4] [command5] [command6] [command7]</td></tr>
<tr><td><ul><li>sub1</li><li>sub2</li><li>sub3</li><li>sub4</li></ul></td><td>This is where content goes. Put lots of content here.</td></tr></table>
</body></html>


**叹气**


这是你能做的最好的吗? :)我以前经历过这些挑战。如果我有时间,我会在今晚晚些时候做。否则,明天某个时候。
**sigh**

Is that the best you can do? :) I''ve gone through these challenges before. If I have time, I''ll do it later tonight. Otherwise, sometime tomorrow.


这篇关于切勿使用表格进行布局。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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