表格单元格中的div宽度增加了额外的空间 [英] div width in table cell adding extra space.

查看:48
本文介绍了表格单元格中的div宽度增加了额外的空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好请帮忙,


我有一个带有div的表格单元格。 div的宽度为300px。

但是当渲染时它会在表格单元格中添加额外的空间。


这里的风格是/>

< style>

#treecontainer

{

高度:100%;

背景:#ffffff;

溢出:隐藏;

BORDER-TOP:1px实体;

BORDER-BOTTOM:1px solid ;

BORDER-LEFT:2px实体;

BORDER-RIGHT:2px实体;

宽度:230px;

显示:内联;

位置:静态;

}

< / style>


这里是HTML片段......


< table border =" 1" CELLSPACING = QUOT; 0" cellpadding =" 0"

style =" width:250px;">

< tr height =" 10">

< td>< / td>

< td>< img src =" ./ images / top-lf-lb.gif"边界=" 0" />< / td>

< td width =" 100%" background =" ./ images / top-repeat-strip-lb.gif">< / td>

< td>< img src =" ./ images / top- RT-lb.gif"边界=" 0" />< / td>

< / tr>

< tr>

< td>< / td>

< td colspan =" 3" style =" PADDING-RIGHT:0px; PADDING-LEFT:0px;

PADDING-BOTTOM:0px;保证金:0px; PADDING-TOP:0px">

< div id =" treecontainer" style =" PADDING-RIGHT:0px; PADDING-LEFT:0px;

PADDING-BOTTOM:0px;保证金:0px; PADDING-TOP:0px">

< / div>

< / td>

< / tr>

< tr height =" 10" id =" r3">

< td width =" 3" valign =" top">

< / td>

< td>< img src =" ./ images / bottom-lf-lb。 GIF" border =" 0">< / td>

< td width =" 100%" background =" ./ images / bottom-repeat-strip-lb.gif">

< img src =" ./ images / sp.gif" border =" 0">< / td>

< td>< img src =" ./ images / bottom-rt-lb.gif" border =" 0">< / td>

< / tr>

< / table>

Hello please help,

I have a table cell with a div in it. The div has a width of 300px.
but when it is rendered it puts extra space into the table cell.

Here''s the style

<style>
#treecontainer
{
HEIGHT: 100%;
BACKGROUND: #ffffff;
overflow: hidden;
BORDER-TOP: 1px solid;
BORDER-BOTTOM: 1px solid;
BORDER-LEFT: 2px solid;
BORDER-RIGHT: 2px solid;
WIDTH: 230px;
DISPLAY: inline;
position: static;
}
</style>

and here is the HTML fragment...

<table border="1" cellspacing="0" cellpadding="0"
style="width:250px;">
<tr height="10">
<td></td>
<td><img src="./images/top-lf-lb.gif" border="0" /></td>
<td width="100%" background="./images/top-repeat-strip-lb.gif"></td>
<td><img src="./images/top-rt-lb.gif" border="0" /></td>
</tr>
<tr>
<td></td>
<td colspan="3" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
<div id="treecontainer" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
</div>
</td>
</tr>
<tr height="10" id="r3">
<td width="3" valign="top">
</td>
<td><img src="./images/bottom-lf-lb.gif" border="0"></td>
<td width="100%" background="./images/bottom-repeat-strip-lb.gif">
<img src="./images/sp.gif" border="0"></td>
<td><img src="./images/bottom-rt-lb.gif" border="0"></td>
</tr>
</table>

推荐答案

MattB写道:
MattB wrote:
你好请帮忙,




直到你不学习多个帖子。

http:/ /smjg.port5.com/faqs/usenet/xpost.html

-

Brian(删除.invalid以发送电子邮件me)
http://www.tsmchughs.com/


2004年7月28日08:20:49 -0700,comp.infosystems中的MattB。 www.authoring.html 写道:
On 28 Jul 2004 08:20:49 -0700, MattB in comp.infosystems.www.authoring.html wrote:
你好请帮助,
我有一个带有div的表格单元格。 div的宽度为300px。
但渲染时它会在表格单元格中添加额外的空间。
Hello please help, I have a table cell with a div in it. The div has a width of 300px.
but when it is rendered it puts extra space into the table cell.




问题是 - 你不应该''把div放到桌子里!桌子分为两个部分




-

注意

这个房间是满满的mit特价电子设备。

手指抓取并按下计算机上的cnoeppkes仅限模具专家使用
!所以所有的左撇子都是远离

并且不要打扰头脑风暴von在这里工作

intelligencies。否则你将被抛出并踢出

anderswhere!另外:请保持静止,只有watchen

才能避开blinkenlights。



The problem is - You shouldn''t put divs into tables! Tables into divs
only.

--
ATTENTION
This room is fullfilled mit special electronische equippment.
Fingergrabbing and pressing the cnoeppkes from the computers is
allowed for die experts only! So all the "lefthanders" stay away
and do not disturben the brainstorming von here working
intelligencies. Otherwise you will be out thrown and kicked
anderswhere! Also: please keep still and only watchen
astaunished the blinkenlights.


marathon< M@linux.ca>写道:
marathon <M@linux.ca> wrote:
2004年7月28日08:20:49 -0700,MattB in comp.infosystems。 www.authoring.html 写道:
On 28 Jul 2004 08:20:49 -0700, MattB in comp.infosystems.www.authoring.html wrote:
你好请帮忙,


我有一个带有div的表格单元格。 div的宽度为300px。
但渲染时它会在表格单元格中添加额外的空间。
I have a table cell with a div in it. The div has a width of 300px.
but when it is rendered it puts extra space into the table cell.



问题是 - 你不应该把div放入表!表格只有div。



The problem is - You shouldn''t put divs into tables! Tables into divs
only.




为什么?

如果你的意思是你不应该使用< table>< ; DIV>直接然后你是

正确,但是< td>< div>是允许的,并且对于某些

复杂的表格数据可能是合理的。


Steve


-

我的理论给你起见,我的异端邪说你们,

我从不回信,你不喜欢我的领带。 - 医生


Steve Pugh< st *** @ pugh.net> < http://steve.pugh.net/>



Why?
If you mean that you shouldn''t use <table><div> directly then you are
correct, but <td><div> is permitted and might be justified for some
complex tabular data.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don''t like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>


这篇关于表格单元格中的div宽度增加了额外的空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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