Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Thu, 6 Oct 2005 09:55:28 +0200,    group: microsoft.public.inetsdk.programming.html_objmodel        back       


Problem when setting width for <table> and <td>   
I have a problem when I am setting the width for the table and td tags. If I
have a width set only for the td tags, and if I am then setting the same
width (the sum of the widths for the td tags) for the table tag, then the
table size is not the same anymore. It seems like IE is adding some extra
space to the td tags in addition to the width that I am setting. Perhaps
this
example will clarify my problem:

<HTML>
<HEAD>
<title>Problem with Width</title>
</HEAD>
<body>
<table border="1" cellpadding="0" cellspacing="0" style="width:100px;">
 <tr><td style="width:100px;">CustomerId</td></tr>
 <tr><td>412791</td </tr>
</table>
</body>
</HTML>

If you view this page in the browser and then remove the style attribute
from the table tag and refresh the page, then the size of the table is
changed.

Is it supposed to be this way and why?

I am using IE 6 SP1.

Thanks in advance.
date: Thu, 6 Oct 2005 09:55:28 +0200   author:   Mikael Jirhage

Re: Problem when setting width for <table> and <td>   
Have a look at borderwidth (border-width) for the cells. I think it
defaults and even if the border is not displayed, it still renders some
space. It shows how to set borderwidth. I think what is happening is
that the cell width is a combination of any 'width' you define plus the
borderwidth. When you deleted the 100px size, as the text can fit in a
smaller space, it renders a smaller space plus the default border
width. I tried it with larger values and border-widths in the table and
a cell

=============
<HTML>
<HEAD>
<title>Problem with Width</title>
</HEAD>
<body>
<table border="1" cellpadding="0" cellspacing="0" style="border-width:
1cm; ">
 <tr><td style="border-width: 0cm; ">CustomerId</td></tr>
 <tr><td>412791</td </tr>
</table>
---------------------------------
<table border="1" cellpadding="0" cellspacing="0" style="border-width:
1cm; width:200px;">
 <tr><td style="border-width: .5cm; width:100px;">CustomerId</td></tr>
 <tr><td>412791</td </tr>
</table>
</body>
</HTML>
=============

I hope this helps

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties/border_0.asp
date: 14 Oct 2005 11:06:44 -0700   author:   rickety

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us