Sign Up   Sign In

Join the community!
Sign in now with your Facebook account.
ForumsTechnicalThread
Forum
Advanced Search
Filter     |   View Watchlist
[ Print Friendly ] [ Watch Thread ]


IE6 table margin problem [ 1 ]
DiMono
DiMono
TheDesolate1
SITE ADMIN
#1   Posted 3 weeks ago
    [ Reply ]   [ Quote ]
So I have the following bit of HTML:
				<div id="content">
<table class='bordertable' cellspacing='0' cellpadding='0'
style='width: 400px; margin-left: auto; margin-right: auto; margin-top: 80px; margin-bottom: 40px;'>
...stuff...
</table>
</div>

In Firefox, works like a charm, as expected. In IE6, which I have to develop for because most big companies are retarded when it comes to web technology, the top and bottom margins are completely ignored unless I insert the following between the <div> and <table>:
<div style='height: 0px; line-height: 0px;'></div>
Does anyone know why this happens and/or how to get around it without adding 0-height divs everywhere I might encounter such a problem?

Note: .bordertable only has borders assigned in the stylesheet, there is no positioning present.
KWierso
KWierso
New Stuff
#2   Posted 3 weeks ago
    [ Reply ]   [ Quote ]
I found this thread, but I think they only managed to get it working with the extra Divs...

The last few posts in this thread talk about collapsing margins.

Can you make it using padding instead of margins?
DiMono
DiMono
TheDesolate1
SITE ADMIN
#3   Posted 3 weeks ago
    [ Reply ]   [ Quote ]
In reply to KWierso, #2:
Can you make it using padding instead of margins?
Nope, messes up the border. I had enough trouble getting the corner rounding to work properly in FF 3.0 already, so fidgeting with it more isn't something I'm looking forward to.

For the rest, my stuff doesn't float.
Xager
Xager
Sponsor
#4   Posted 2 weeks ago
    [ Reply ]   [ Quote ]
Do you have to use a table? and also check the containing div, it can mess with underlying styling.
[ 1 ]