HighDots Forums  

Why doesn't Mozilla collapse vertical margins between <table> and other blocks?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Why doesn't Mozilla collapse vertical margins between <table> and other blocks? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Why doesn't Mozilla collapse vertical margins between <table> and other blocks? - 12-08-2003 , 02:55 PM






I have these styles:

p, pre, table { margin: 1em; }

And this HTML:

<p>A paragraph</p>
<table><tr><td>A table</td></tr></table>
<pre>A preformatted block</pre>
<p>A paragraph</p>

In IE6, the vertical space between all blocks is 1em. But in
Netscape/Firebird, there's 2em space before and after the table. Why
don't the margins collapse? What's the CSS for "at least 1em margin
around all blocks"?

Reply With Quote
  #2  
Old   
Stan Brown
 
Posts: n/a

Default Re: Why doesn't Mozilla collapse vertical margins between <table> and other blocks? - 12-08-2003 , 05:07 PM






In article <83d55d8.0312081155.21655699 (AT) posting (DOT) google.com> in
comp.infosystems.www.authoring.stylesheets, Michael Liu
<practicalvb (AT) hotmail (DOT) com> wrote:
Quote:
But in
Netscape/Firebird, there's 2em space before and after the table.
I haven't seen that in my own pages, and you didn't give us a URL.

Perhaps you should try setting padding to 0?

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/


Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default Re: Why doesn't Mozilla collapse vertical margins between <table> and other blocks? - 12-09-2003 , 11:25 AM



Stan Brown <the_stan_brown (AT) fastmail (DOT) fm> wrote

Quote:
In article <83d55d8.0312081155.21655699 (AT) posting (DOT) google.com> in
comp.infosystems.www.authoring.stylesheets, Michael Liu
practicalvb (AT) hotmail (DOT) com> wrote:
But in
Netscape/Firebird, there's 2em space before and after the table.

I haven't seen that in my own pages, and you didn't give us a URL.

Perhaps you should try setting padding to 0?
Thanks for replying.

Here's a URL: http://home.pacbell.net/nexus/temp.html
Setting padding to 0 (as done in this page) doesn't seem to help.

I viewed this page in IE6 SP1 and Firebird 0.7 on Windows XP. I
didn't try it with this particular page, but a similar problem
occurred on another page with Netscape 7.1.


Reply With Quote
  #4  
Old   
Steve Pugh
 
Posts: n/a

Default Re: Why doesn't Mozilla collapse vertical margins between <table> and other blocks? - 12-09-2003 , 12:02 PM



practicalvb (AT) hotmail (DOT) com (Michael Liu) wrote:
Quote:
Michael Liu <practicalvb (AT) hotmail (DOT) com> wrote:

But in
Netscape/Firebird, there's 2em space before and after the table.


Here's a URL: http://home.pacbell.net/nexus/temp.html
Setting padding to 0 (as done in this page) doesn't seem to help.

I viewed this page in IE6 SP1 and Firebird 0.7 on Windows XP. I
didn't try it with this particular page, but a similar problem
occurred on another page with Netscape 7.1.
The problem vanishes if you set table to display: block, and appears
between two adjacent paragraphs if p is set to display: table.

I believe this is a bug in Gecko's handling of display: table as the
CSS specs seem to be clear that display: table generates a block level
box and that vertical margins of block level boxes should be
collapsed.
http://www.w3.org/TR/CSS2/tables.html#q2
http://www.w3.org/TR/CSS2/box.html#x24
http://www.w3.org/TR/CSS2/visuren.html#q5

For more information on whether this is a bug and whether it's likely
to be fixed soon I'd suggest searching Bugzilla or asking on a Mozilla
newsgroup.

Any work around would depend on your particular design. In the simple
test case given here setting table {margin: 0 1em} would suffice.

Steve

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

Steve Pugh <steve (AT) pugh (DOT) net> <http://steve.pugh.net/>


Reply With Quote
  #5  
Old   
AT
 
Posts: n/a

Default Re: Why doesn't Mozilla collapse vertical margins between <table> and other blocks? - 12-10-2003 , 05:36 PM



Steve Pugh <steve (AT) pugh (DOT) net> wrote

Quote:
The problem vanishes if you set table to display: block, and appears
between two adjacent paragraphs if p is set to display: table.

I believe this is a bug in Gecko's handling of display: table as the
CSS specs seem to be clear that display: table generates a block level
box and that vertical margins of block level boxes should be
collapsed.
Thanks for replying. I looked up this bug in Bugzilla:
http://bugzilla.mozilla.org/show_bug.cgi?id=87277
It was reported more than two years ago, but still hasn't been fixed.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.