宽度和填充/边距.. [英] Widths and padding / margin..

查看:70
本文介绍了宽度和填充/边距..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个元素周期表

为< DIV> s ..(轻笑 - 开个玩笑!)a< TABLE>

at http://www.physci.org/test/chem/

或者更确切地说,表格本身就是......
http://www.physci.org/test/chem/ptoe.html


它包含有效的HTML和CSS

(检查''时刻''之前)。


在XP上测试IE 6。我的问题..

表格单元格的''width''值似乎没有影响
没有效果,可以设置吗?如果是这样,怎么样?

如何缩小细胞之间的间隙

含有化学元素?


TIA


-

Andrew Thompson
http://www.AThompson.info/
http:// www.PhySci.org/
http://www.1point1C.org /

解决方案

文章< CC ******************* **@news-server.bigpond.net.au> ;,

" Andrew Thompson" <一个****** @ bigNOSPAMpond.com>写道:

我正在开发一个元素周期表
as< DIV> s ..(轻笑 - 开个玩笑!)


我们在这里有什么?!一个friggin''喜剧演员。 :)

a< TABLE>
http://www.physci.org/test/chem/ ,或者更确切地说,表格本身就是......
http://www.physci.org/test/chem/ptoe.html

非常很好!

它包含有效的HTML和CSS
(已检查''时刻'')。


你可能想再次检查:

< http://validator.w3.org/check?uri=ht...org%2Ftest%2Fc

下摆%2Fptoe.html>

我在XP上测试IE 6。我的问题..
表格单元格的''width''值似乎没有影响,它们可以设置吗?如果是这样,怎么样?


使用CSS设置单元格的宽度,并且不要为

TABLE元素设置任何宽度,因为它的结果宽度将为是单元格宽度的总和



如果你坚持使用具有明确宽度的TABLE,那么

你想象一个浏览器在为单元格设置显式宽度时的行为吗?


回到表格布局的时代,我们经常遇到以下情况:


< table width =" 100%">

< tr>

< td width =" 200"> ; ...< / td>< td> ..< / td>

< / tr>

< / table>


该表适合于它的容器的可用宽度

(通常是浏览器窗口),第一个单元格将明确为200

像素宽,第三个单元格占据桌子边界内剩下的任何空间




现在,想象一下:


< table width =" 100%">

< tr>

< td width = " 200" ..< / td>< td width =" 200"> ..< / td>

< / tr>

< / table>


浏览器需要做什么?如果浏览器忽略单元格的宽度,我觉得很合理。既然我们用CSS做了演示,那就不是那么多了。

我怎样才能消除含有化学元素的细胞之间的差距呢? / blockquote>


< table ... cellspacing =" 0">


-

Kris
kr*******@xs4all.neth erlands(nl)


* Andrew Thompson *< an ****** @ bigNOSPAMpond.com>:


我正在开发一个周期表元素
as< DIV> s ..(轻笑 - 开个玩笑!)a< TABLE>


嘿,我曾经想做同样的事情来测试HTML4表格提供的所有功能,但很快就失去了兴趣。

表格单元格的宽度值似乎没有效果,可以设置吗?


是的。


|适用于:所有元素但未替换的内联元素,表行和行组


OTOH''margin''不适用于表格单元格和其他内部表格

元素。

如果是这样,怎么样?


在单元格(''td''或''th'')上的''width''属性或列

(' 'col''或''colgroup'')。您可能无法使用默认使用的

自动表算法来查看它。试试table-layout:fixed。

如何消除含有化学元素的细胞之间的差距?




border-collapse:collapse ;


如果使用值''separate'',您可以使用

''border-spacing''属性指定距离。 IIRC IE不支持后者。


PS:还没有创建元素113和114吗?

"周期表元素应该是''标题'',(c)Andrew

Thompson,2003在''tfoot'和& copy;存在。不过,您对该页面上的数据拥有

任何^知识产权都是值得怀疑的。


-

演讲中有三件事情重要:

谁说出来,他怎么说,以及他说了什么,

和三,最后最重要的事情。


在文章Andrew Thompson写道:

我正在开发一个元素周期表
as< DIV> s ..(笑) - 开玩笑吧!)a< TABLE>
http:// www.physci.org/test/chem/ ,或者更确切地说,表格本身就是......
http://www.physci.org/test/chem/ptoe.html

它包含有效的HTML和CSS
(检查''时刻'')。

我在XP上测试IE 6。我的问题..
表格单元格的''width''值似乎没有影响,它们可以设置吗?


浏览器不要做任何愚蠢的事情,因为将所有单元格设置为25英尺宽,然后

你会得到一英里长的滚动条。


没有合理的浏览器允许。你也使用宽度:100%表。

你怎么看待这两种情况发生?如果你不使用宽度:100%用于表格,并且

使用小的enaugh值来获得elemenent单元格宽度(这样整个表格

适合视口),然后全部细胞大小相同。至少在Opera 7.21中。

如何消除含有化学元素的细胞之间的差距?




table {border-崩溃:崩溃;}

-

Lauri Raittila< http://www.iki.fi/lr> < http://www.iki.fi/zwak/fonts>

Saapi l?hett ?? meili?,jos aihe ei liity ryhm ?? n,tai on yksityinen

tjsp。,mutta?l? L·海特? samaa viesti? meilitse ja ryhm ?? n。


I am developing a Periodic Table of the Elements
as<DIV>s ..(chuckle - just kidding!) a <TABLE>
at http://www.physci.org/test/chem/,
or rather, the table itself is..
http://www.physci.org/test/chem/ptoe.html

It contains valid HTML and CSS
(checked ''moments'' ago).

Am testing in IE 6 on XP. My questions..
The ''width'' value of table cells seems to have
no effect, can they be set? If so, how?
How can I collapse the gap between cells
containing chemical elements?

TIA

--
Andrew Thompson
http://www.AThompson.info/
http://www.PhySci.org/
http://www.1point1C.org/

解决方案

In article <CC*********************@news-server.bigpond.net.au>,
"Andrew Thompson" <an******@bigNOSPAMpond.com> wrote:

I am developing a Periodic Table of the Elements
as<DIV>s ..(chuckle - just kidding!)
What do we have here?! A friggin'' comedian. :)
a <TABLE>
at http://www.physci.org/test/chem/,
or rather, the table itself is..
http://www.physci.org/test/chem/ptoe.html
Very nice!

It contains valid HTML and CSS
(checked ''moments'' ago).
You may want to check again:
<http://validator.w3.org/check?uri=ht...org%2Ftest%2Fc
hem%2Fptoe.html>

Am testing in IE 6 on XP. My questions..
The ''width'' value of table cells seems to have
no effect, can they be set? If so, how?
Set the width for a cell, using CSS and don''t set any width for the
TABLE element, since it''s resulting width will be the sum of the width
of the cells.

If you however insist on the TABLE having an explicit width, then what
do you imagine a browser to behave when you set explicit width for cells?

Back in the days of table-layouts, we often had the following situation:

<table width="100%">
<tr>
<td width="200">..</td><td>..</td>
</tr>
</table>

The table would fit itself to the available width of it''s container
(often, the browser window), the first cell would be explicitly 200
pixels wide and the third cell would occupy whatever space was left
within the table''s boundaries.

Now, imagine:

<table width="100%">
<tr>
<td width="200">..</td><td width="200">..</td>
</tr>
</table>

What would a browser need to do with this? I find it quite reasonable if
a browser ignores the widths on the cells. Now that we do presentational
things with CSS, it is not really that much different.
How can I collapse the gap between cells
containing chemical elements?



<table ... cellspacing="0">

--
Kris
kr*******@xs4all.netherlands (nl)


*Andrew Thompson* <an******@bigNOSPAMpond.com>:


I am developing a Periodic Table of the Elements
as<DIV>s ..(chuckle - just kidding!) a <TABLE>
Hey, I once wanted to do the same to test all the features that HTML4 tables
provide, but quickly lost interest.
The ''width'' value of table cells seems to have no effect, can they be set?
Yes.

| Applies to: all elements but non-replaced inline elements, table rows, and row groups

OTOH ''margin'' doesn''t apply to table-cells and the other internal table
elements.
If so, how?
With the ''width'' property either on the cells (''td'' or ''th'') or the column
(''col'' or ''colgroup''). You''ll probably not be able to see it with the
automatic table algorithm used by default. Try "table-layout: fixed.
How can I collapse the gap between cells containing chemical elements?



border-collapse: collapse;

If you use the value ''separate'', you can specify the distance with the
''border-spacing'' property. IIRC IE doesn''t support the latter.

P.S.: Haven''t elements 113 and 114 also been created already?
"Periodic Table of the Elements" should be in ''caption'', "(c) Andrew
Thompson, 2003" in ''tfoot'' and &copy; exists. It''s doubtful that you own
any^Wmuch intellectual property on the data on that page, though.

--
Three things matter in a speech:
who says it, how he says it, and what he says,
and of the three, the last matters least.


In article Andrew Thompson wrote:

I am developing a Periodic Table of the Elements
as<DIV>s ..(chuckle - just kidding!) a <TABLE>
at http://www.physci.org/test/chem/,
or rather, the table itself is..
http://www.physci.org/test/chem/ptoe.html

It contains valid HTML and CSS
(checked ''moments'' ago).

Am testing in IE 6 on XP. My questions..
The ''width'' value of table cells seems to have
no effect, can they be set?
Browser don''t do anything as stupid as set all cells 25 em wide, as then
you would get mile long scrollbar.

No sensible browser allows that. You are also using width:100% for table.
How do you expect both happen? If you don''t use width:100% for table, and
use small enaugh value for elemenent cell widths (so that whole table
fits viewport), then all cells will be same size. At least in Opera 7.21.
How can I collapse the gap between cells
containing chemical elements?



table {border-collapse:collapse;}
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi l?hett?? meili?, jos aihe ei liity ryhm??n, tai on yksityinen
tjsp., mutta ?l? l?het? samaa viesti? meilitse ja ryhm??n.


这篇关于宽度和填充/边距..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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