CSS vs Tables [英] CSS vs Tables

查看:62
本文介绍了CSS vs Tables的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Duh ......


不是另一个......


希望很简单,我讨厌* I *(和它可能是一个CSS

特性)不能将固定宽度的分割元素与变量混合

自动扩展div ???


我喜欢桌子的好处是能够说:


< table width = 90%>

< tr>

< td width = 100>左栏< / td>

< td width =" *"> Content Here< / td>

< td width = 100>右栏< / td>

< / tr>

< / table>


和中间列将被渲染以填满剩余的空间!

太棒了!


但是还有另一种CSS技巧吗?


是否有一些技巧可以连接你会不会像桌子一样使用柱状div?


我意识到桌子不能用于布局等等,而且我大部分时间都很满意这对... CSS和Div工作...我只是不想与

800宽度网站一起工作,试图与旧屏幕兼容。


有什么想法吗?


谢谢

Simon

Duh...

Not another one...

Hopefully simple though, I hate the way *I* (and it might be a CSS
trait) can''t intermix fixed width divisional elements with a variable
auto expanding div???

The great thing I loved with Tables, was being able to say:

<table width=90%>
<tr>
<td width=100>Left Column</td>
<td width="*">Content Here</td>
<td width=100>Right Column</td>
</tr>
</table>

and the middle column would be rendered to fill up the remaining space!
Great!

But is there another trick with CSS?

Is there some trick to "connect" columnal divs like you would a table?

I realise that tables aren''t to be used for layout etc, and Im mostly
happy with the way CSS and Divs work... I just don''t want to work with
800 width sites for eternity trying to be compatible with older screens.

Any thoughts?

Thanks
Simon

推荐答案

Simon Dean schrieb:
Simon Dean schrieb:

我喜欢桌子的好处是能够说:


< table width = 90%> ;

< tr>

< td width = 100>左栏< / td>

< td width =" * "> Content Here< / td>
The great thing I loved with Tables, was being able to say:

<table width=90%>
<tr>
<td width=100>Left Column</td>
<td width="*">Content Here</td>



什么是width =" *"对于? width属性值定义为

长度。


#长度:值(%长度;在DTD中)可以是%Pixel ;或者可用水平或垂直空间的
百分比。因此,

值50%意味着可用空间的一半。


< td>内容这里< / td>

做同样的事情(至少在当前的FF,IE和Opera中)在Win)。

-

Johannes Koch

在te domine speravi;非永久性的东西。

(Te Deum,4美分。)

What is the width="*" for? The width attribute value is defined to be a
Length.

# Length: The value (%Length; in the DTD) may be either a %Pixel; or a
percentage of the available horizontal or vertical space. Thus, the
value "50%" means half of the available space.

<td>Content Here</td>
does the same (at least in current FF, IE and Opera on Win).
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)


Simon Dean< sj **** @ simtext.plus。 comwrote:
Simon Dean <sj****@simtext.plus.comwrote:

> Duh ...

不是另一个...
>Duh...

Not another one...



那么*是*你的借口开始另一个CSS vs表格线程

而不是搜索群组的档案?

So what *is* your excuse to start yet another CSS vs tables thread
instead of searching the group''s archives?


>希望很简单,我讨厌* I *(它可能是一个CSS
特性)不能将固定宽度的分区元素与变量
自动扩展div混合? ?

我喜欢桌子的好处是能够说:

< table width = 90%>
< tr>
< td width = 100>左列< / td>
< td width =" *"> Content Here< / td>
< td width = 100> Right Column< ; / td>
< / tr>
< / table>

并且中间列将被渲染以填满剩下的空间!
太棒了!

但CSS还有其他技巧吗?

是否有一些技巧可以连接你会不会像一张桌子那样使用柱状div?

我意识到桌子不能用于布局等等,而且我对CSS和Div的工作方式非常满意......我只是不想使用
800宽度的网站永恒,试图与旧屏幕兼容。
>Hopefully simple though, I hate the way *I* (and it might be a CSS
trait) can''t intermix fixed width divisional elements with a variable
auto expanding div???

The great thing I loved with Tables, was being able to say:

<table width=90%>
<tr>
<td width=100>Left Column</td>
<td width="*">Content Here</td>
<td width=100>Right Column</td>
</tr>
</table>

and the middle column would be rendered to fill up the remaining space!
Great!

But is there another trick with CSS?

Is there some trick to "connect" columnal divs like you would a table?

I realise that tables aren''t to be used for layout etc, and Im mostly
happy with the way CSS and Divs work... I just don''t want to work with
800 width sites for eternity trying to be compatible with older screens.



可能最重要的原因*为什么*表格是一个糟糕的选择

创建一个布局是按照上面说明的方式使用时,他们不允许适当的增量渲染。使用表格进行布局时,错误的问题是一个非常不重​​要的问题。


使用div元素可以获得相同的行为,但是

用div元素替换表元素将是很好的,如果你那么

模仿大多数表格布局所遭受的最重要的问题。


这里真正的问题是你想要简单的布局,但是对于你来说很简单,对于你来说,作者给用户带来了令人讨厌的问题。真正的

解决方案是努力理解尺寸为

符合内​​容的问题。布局,然后学习编码,这样你就不再需要这个讨厌的行为了。


-

Spartanicus

Probably the most important reason *why* tables are a bad choice for
creating a "layout" is that when used in the manner illustrated above
they do not allow proper incremental rendering. The problem of false
semantics when using tables for layout is a far less important issue.

It is possible to get the same behaviour with div elements, but
replacing table elements with div elements would be farcical if you then
emulate the most important problem that most table layouts suffer from.

The real problem here is that you want easy layouts, but what is easy
for you the author is causing nasty problems for the user. The real
solution is to make an effort to understand the problems with "size to
fit the content" layouts, and then learn to code so that you don''t need
this nasty behaviour anymore.

--
Spartanicus


Simon Dean写道:
Simon Dean wrote:

我喜欢桌子的好处是能够说:


< table width = 90%>

< tr>

< td width = 100> Left Column< ; / td>

< td width =" *"> Content Here< / td>

< td width = 100> Right Column< / td> ;

< / tr>

< / table>
The great thing I loved with Tables, was being able to say:

<table width=90%>
<tr>
<td width=100>Left Column</td>
<td width="*">Content Here</td>
<td width=100>Right Column</td>
</tr>
</table>



我可以问一下你喜欢这种布局的浏览器是什么?绝对没有在

NN3 / IE3或NN4 / IE4:他们有基本不同的内部公式

计算像素/百分比混合列的余数:这就是为什么它

从未像您发布的那样直接使用。你必须受到表格栏和框架集的污染。


您的桌子占据了90%的页面还是在一些较小的容器内?

内容是100px列还是空边框?

May I ask what browser did you enjoy this layout on? Definitely not on
NN3/IE3 or NN4/IE4 : they had cardinally different internal formulas to
calculate remainders for pixel/percentage mixed columns: this is why it
never was used as straight as you posted. You must be having a
contamination of table columns and frameset cols.

Does your table take 90% of page or it''s inside some smaller container?
Are 100px columns for content or just empty borders?


这篇关于CSS vs Tables的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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