Forum Moderators: open

Message Too Old, No Replies

Tables refuse to align properly in IE

... The hell?

         

Wertigon

10:02 am on Nov 24, 2003 (gmt 0)

10+ Year Member



Okay, I have several tables, each with 7 or 8 columns, like so;

<table>
<tr>
<th>Blah</th>
<th>Blah2</th>
<th>Blah3</th>
</tr>
<tr>
<td>Bleah</td>
<td>Bleah</td>
<td>Bleah</td>
</tr>
[etc]
</table>

I want it to display something like


¦----------------------------¦
¦ Blah ¦ Blah2 ¦ Blah3 ¦
¦----------------------------¦
¦ Bleah ¦ Bleah2 ¦ Bleah3 ¦
¦--------¦---------¦---------¦

¦----------------------------¦
¦ Blah ¦ Blah2 ¦ Blah3 ¦
¦----------------------------¦
¦ Bleah ¦ Bleah2 ¦ Bleah3 ¦
¦--------¦---------¦---------¦

However, in IE I get


¦-------------------------------¦
¦ Blah ¦ Blah2 ¦ Blah3 ¦
¦-------------------------------¦
¦ Bleah ¦ Bleah2 ¦ Bleah3 ¦
¦--------¦---------¦------------¦

¦----------------------------¦
¦ Blah ¦ Blah2 ¦ Blah3 ¦
¦----------------------------¦
¦ Bleah ¦ Bleah2 ¦ Bleah3 ¦
¦--------¦---------¦---------¦

Now, I've tried using CSS and setting the width of all tables to 100%, but to no avail. It's working beautifully in Opera and Moz (even without the 100% rule), but IE just refuses to acknowledge it. Anyone know how to fix this?

hakre

10:18 am on Nov 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi Wertigon,

i don't understand your problem complely, but it might be that a simple

<table width="100%">
solves your problem.

if not, then check which is the parent block element of the table, because the 100% width rule is based to the width of the parent element.

if you don't want to display the table on the width of the complete page, then please specify what exactly your problem is.

Wertigon

1:16 pm on Nov 24, 2003 (gmt 0)

10+ Year Member



No, I want to do exactly that; The problem I'm having is that the tables end up being of a different width when they shouldn't in IE. So while one table can be 100% wide another might be 97% wide and a third becomes 98% wide. Note that this is IE specific; In Moz and Opera they look just fine.

I tried the css rule

table{width : 100%;}
but to no avail, and I'd rather not use the width attribute (trying to do this in Strict if possible).