CSS与表格 [英] CSS vs. tables

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

问题描述

我开始学习如何编写CSS与使用表格。我已经使用了

表多年,并且可以用它们做任何事情。然而

我可以看到CSS更灵活和更紧凑(看起来更多和更多人正在使用它)。


我已经在网上为CSS做了一些教程,并且正在接受。但是我

有几个基本问​​题。


有了桌子,我以前能够有一个有2列的桌子,用于

实例就像一个表格:


用户名| < form goes here>

您的真实姓名| < form goes here>


我根本不想包装左栏。我可以在第一列1%和另一列99%和第一列

列中使用

表。这很完美。


我似乎不能用CSS使用DIV复制那种效果。我可以调整

的百分比,这样它就不会换行,但是如果用户增加了

的字体大小,那么它就会换行。使用旧表方法,如果用户增加了字体大小,那就无所谓了。


这些行似乎是彼此独立的,唯一的东西共同点是他们

属于同一类,所以他们有相同的宽度百分比。除了

之外,它看起来并不像是附加,这意味着如果一行有一个

长的句子,其他行都不在乎。


抱歉这么混乱!希望有人可以提供帮助。

解决方案

2005年8月11日星期四15:53:27 -0400,Dave Thomas< ge **** @ hotmail.com>写道:

我开始学习如何编写CSS与使用表格。我已经使用了
表多年,并且可以用它们做任何事情。然而
我可以看到CSS如何更灵活和更紧凑(似乎更多和更多人正在使用它)。

我在网上做了一些教程CSS和我一直在追赶。但是我有几个基本问​​题。

对于表格,我曾经能够有一个包含2列的表格,用于
实例,如表格:

用户名| < form goes here>
你的真实姓名| <形式在这里>

我根本不想包装左栏。我可以用第一列1%和另一列99%做一个表,在第一列
列中有一个nowrap。这很完美。

我似乎不能用CSS使用DIV复制那种效果。我可以调整百分比以使其不会换行,但如果用户增加了字体大小,那么它将会换行。使用旧表方法,如果用户增加字体大小就无所谓了。

这些行似乎是彼此独立的,唯一的共同点是它们
属于同一类,因此它们具有相同的宽度百分比。除此之外,它看起来并不像是附着,这意味着如果一行有一个长句,其他行也不在乎。

抱歉这么混乱!希望有人可以提供帮助。




我经常使用Opera的快捷按钮来显示页面结构 - 用页面样式替换

我自己的桌面边框和我自己的链接样式。

(通常需要使页面可读并显示链接 -

评论fancy页面设计 - 另一个主题另一天。)


我已经了解到绝大多数(95%)的页面,包括非常重要的*

页面通过* table *和css构建,使它们漂亮,

便于设计编辑。


基于这个事实和我的经验尝试用css实现我的页面结构

,我的结论是*所有*页面结构应该用
表来完成。一旦布局建立,css非常有用 - 几乎

如果一个网站有很多页面就必不可少。


原因是css是将布局与内容分开的尝试失败。

在适当的时候,它将被一个稳定,简单的方法取代。对于

来说,实现稳定的多浏览器布局的困难太多了

很棒。


这是一个不受欢迎的观点这里是css小组。


Mason C(我不会回应火焰。)


强制性链接: http://masonc.home.netcom.com


< blockquote> Dave Thomas写道:


对于表格,我曾经有一个包含2列的表格,用于
实例,如表格:

用户名| < form goes here>
你的真实姓名| < form goes here>

表格用于表格数据。定义表格可以得到一点

棘手。您在上面显示的IMO输入表单是表格式的。

我根本不想包装左栏。我可以用第一列1%和另一列99%做一个表,在第一列
列中有一个nowrap。这非常有效。



这是一个适当的表格使用。

CSS在布局时更强大;表回顾

是一种明显不灵活且冗长的布局方法。

你看过CSS Zen Garden了吗? < http://www.csszengarden.com/>

使用CSS可以做些什么令人惊讶。所有样本布局都使用

*相同* HTML。


-

jmm dash list(at)sohnen- moe(dot)com

(删除电子邮件的.AXSPAMGN)


看看: http://jeffhowden.com/code/css/forms/ 它使用了

< label> -tag用于按照您希望的方式定位ield。

也许您必须添加white-space:nowrap。祝你好运。


祝你好运!


-

Niek Emmen,Sitebouwer

Sebastian Webprojecten

Poststraat 68

5038 DH Tilburg

t 013 518 61 20

f 013 518 61 21

i http://www.sebastian.nl


I am starting to learn how to code CSS vs using tables. I have used
tables for many years, and can do just about anything with them. However
I can see how CSS is more flexible and compact (and seems like more and
more people are using it).

I have done a few tutorials on the web for CSS and am catching on. But I
have a couple basic questions.

With tables, I used to be able to have a table with 2 columns, for
instance like a form:

username | <form goes here>
Your Real Name | <form goes here>

I wouldn''t want to wrap the left column at all. I could do a table with
the first column 1% and the other column 99%, and a nowrap in the first
column. This worked perfect.

I can''t seem to duplicate that effect with CSS using DIV''s. I can adjust
the percentages so that it doesn''t wrap, but if a user increases the
font size then it will wrap. With the old table method, if a user
increased the font size it didn''t matter.

The rows seem independent of eachother, the only thing in common is they
are of the same class, so they have the same width percentage. besides
that, it doesn''t look like they are "attached", meaning if one row has a
long sentence the other rows don''t care.

Sorry to be so confusing! hopefully someone can help.

解决方案

On Thu, 11 Aug 2005 15:53:27 -0400, Dave Thomas <ge****@hotmail.com> wrote:

I am starting to learn how to code CSS vs using tables. I have used
tables for many years, and can do just about anything with them. However
I can see how CSS is more flexible and compact (and seems like more and
more people are using it).

I have done a few tutorials on the web for CSS and am catching on. But I
have a couple basic questions.

With tables, I used to be able to have a table with 2 columns, for
instance like a form:

username | <form goes here>
Your Real Name | <form goes here>

I wouldn''t want to wrap the left column at all. I could do a table with
the first column 1% and the other column 99%, and a nowrap in the first
column. This worked perfect.

I can''t seem to duplicate that effect with CSS using DIV''s. I can adjust
the percentages so that it doesn''t wrap, but if a user increases the
font size then it will wrap. With the old table method, if a user
increased the font size it didn''t matter.

The rows seem independent of eachother, the only thing in common is they
are of the same class, so they have the same width percentage. besides
that, it doesn''t look like they are "attached", meaning if one row has a
long sentence the other rows don''t care.

Sorry to be so confusing! hopefully someone can help.



I frequently use Opera''s quick button to reveal page structure -- by replacing
the page style with my own with table borders and my own link style.
(This is often necessary to make the page readable and reveal the links -- a
comment on "fancy" page design -- another subject another day.)

I''ve learned that the vast majority (95%) of pages, including very *significant*
pages are structured by means of *tables* with css to make them pretty and
facilitate design editing.

Based on this fact and my experience trying to achieve my page structure
with css, my conclusion is that *all* page structure should be done with
tables. Once the layout is established, css is very useful -- almost
essential if a site has many pages as mine does.

The reason is that css is a failed attempt to separate layout from content.
In due course it will be replaced by a stable, simpler method. For the
present the difficulties in achieving a stable many-browser layout are too
great.

This is an unpopular view here on the css group.

Mason C ( I will not respond to flames.)

Obligatory link: http://masonc.home.netcom.com


Dave Thomas wrote:


With tables, I used to have a table with 2 columns, for
instance like a form:

username | <form goes here>
Your Real Name | <form goes here>
Tables are for tabular data. Defining "tabular" can get a little
tricky. IMO input forms as you show above are tabular.
I wouldn''t want to wrap the left column at all. I could do a table with
the first column 1% and the other column 99%, and a nowrap in the first
column. This worked perfectly.


And it is an appropriate use of a table.
CSS is much more powerful when it does the layout; tables in retrospect
are an obviously inflexible and verbose method for layout.
Have you looked at the CSS Zen Garden? <http://www.csszengarden.com/>
It is amazing what can be done with CSS. All of the sample layouts use the
*same* HTML.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)


Take a look at: http://jeffhowden.com/code/css/forms/ it uses the
<label>-tag for positioning the ields in the way you would like to.
Maybe you have to add "white-space: nowrap" somewhere.

Good luck!

--
Niek Emmen, Sitebouwer

Sebastian Webprojecten
Poststraat 68
5038 DH Tilburg
t 013 518 61 20
f 013 518 61 21
i http://www.sebastian.nl


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

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