Previous Message
Next Message

table width problem in IE?

Sent by Philippe Wittenbergh on 25 November 2003 01:01


On Tuesday, November 25, 2003, at 04:22 AM, David Feldman wrote:

>> Any chance of a test url? :) Its really hard to see what the problem 
>> is without one,
>
> Sure. Here's a simple page that exhibits the problem:
> http://interfacethis.com/misc/css-test/ie-table.html
>
> - The body margin and padding are set to 0.
> - The DIV has its padding set to 20px.
> - The table has its width set to 100%
> - The table and its cells have 0 for padding, margin, and border.
>
> Mozilla gets it right: The table is the full width of the available 
> space inside the DIV (i.e. the page width minus 40px). But IE6 makes 
> the table the full _page_ width, ignoring the DIV's settings and thus 
> running off the right side.

Win IE5.x (and IE6 in quirks mode) cannot correctly calculate the 
percentage width of a table when the parent container doesn't have a 
width specified. It calculates the width of the table based on the 
width of <body>.....

A solution: add one more div, inside your existing div, and specify a 
width on that div:
div.innerdiv {width:100%}

html:
<div>
	<div class="innerdiv"><table>...................</table></div>
</div>

Philippe

== | == | == | == | == | == | == | == | == | == | == | ==

Philippe Wittenbergh

code | design | web projects : <http://www.l-c-n.com/>
online image gallery : <http://www.l-c-n.com/phiw/>
IE5 Mac bugs and oddities : <http://www.l-c-n.com/IE5tests/>

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: