473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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

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"?
Jul 20 '05 #1
4 2442
In article <83*************************@posting.google.com> in
comp.infosystems.www.authoring.stylesheets, Michael Liu
<pr*********@hotmail.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?

--
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/
Jul 20 '05 #2
Stan Brown <th************@fastmail.fm> wrote in message news:<MP************************@news.odyssey.net> ...
In article <83*************************@posting.google.com> in
comp.infosystems.www.authoring.stylesheets, Michael Liu
<pr*********@hotmail.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.
Jul 20 '05 #3
pr*********@hotmail.com (Michael Liu) wrote:
Michael Liu <pr*********@hotmail.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 <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #4
Steve Pugh <st***@pugh.net> wrote in message news:<jl********************************@4ax.com>. ..
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.
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Philo | last post by:
How do I select all <div> tags except those which contain a <table> tag somewhere within them? Example XML: <********************** sample input ***********************> <txtSectionBody>...
8
by: bearclaws | last post by:
I am looping through a list of categories and want to display the list horizontally (instead of vertically). I want to create a single row with 4 list items in each cell of the row. I thought...
61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
19
by: CMAR | last post by:
I have the following markup. The problem is that the browser, e.g., IE6, inserts several lines of blank space between the <div> and the following table. Is there a way to minimize that vertical...
0
by: timnels | last post by:
I've got a bizzare issue where I have an XML file to load into a data set like: <conversion> <table name="parent"> <table name="child"> </table> </table> <table name="another parent"> ....
8
by: ASP Yaboh | last post by:
I have an ArrayList of data gathered from a database. I want to create a web page from this data by creating a <table>, each cell in each row displays the appropriate data. One of those cells in...
13
by: Davo | last post by:
Hi Folks, There seems to be something about not using tables for layout, but use divs instead. I'm not sure if I've got this right. If the output looks like what you want, then it shouldn't...
12
by: slartybartfast | last post by:
I'm new(ish) to css, comfortable using tables, but trying real hard to move away. Please see http://84.9.125.31/developer/css_test/test5.html NB This issue is with IE & Opera - I've tried IE...
0
by: =?Utf-8?B?R3JlZw==?= | last post by:
I've created my table and alli is fine. I name my <tdtags to make them easier to identify when my table gets large. Anyway, I am naming as such: <td id="cellName" > Now, sometimes when make a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.