Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 51597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:46:31+00:00 2026-05-10T16:46:31+00:00

From my understanding of the CSS spec, a table above or below a paragraph

  • 0

From my understanding of the CSS spec, a table above or below a paragraph should collapse vertical margins with it. However, that’s not happening here:

table {   margin: 100px;   border: solid red 2px; } p {   margin: 100px }
<table>   <tr>     <td>       This is a one-celled table with 100px margin all around.     </td>   </tr> </table>  <p>This is a paragraph with 100px margin all around.</p>

I thought there would be 100px between the two elements, but there are 200px — the margins aren’t collapsing.

Why not?

Edit: It appears to be the table’s fault: if I duplicate the table and duplicate the paragraph, the two paragraphs will collapse margins. The two tables won’t. And, as noted above, a table won’t collapse margins with a paragraph. Is this compliant behaviour?

table {   margin: 100px;   border: solid red 2px; }
<table>   <tr>     <td>       This is a one-celled table with 100px margin all around.     </td>   </tr> </table> <table>   <tr>     <td>       This is a one-celled table with 100px margin all around.     </td>   </tr> </table>

p {   margin: 100px }
<p>This is a paragraph with 100px margin all around.</p> <p>This is a paragraph with 100px margin all around.</p>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T16:46:32+00:00Added an answer on May 10, 2026 at 4:46 pm

    Margin collapsing is only defined for block elements. Try it – add display: block to the table styles, and suddenly it works (and alters the display of the table…)

    Tables are special. In the CSS specs, they’re not quite block elements – special rules apply to size and position, both of their children (obviously), and of the table element itself.

    Relevant specs:

    http://www.w3.org/TR/CSS21/box.html#collapsing-margins
    http://www.w3.org/TR/CSS21/visuren.html#block-box

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 66k
  • Answers 66k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer If Table3 contains all values in Table1 UNION Table2, then… May 11, 2026 at 11:22 am
  • added an answer To check a column for DBNull in a DataSet, you… May 11, 2026 at 11:22 am
  • added an answer I tried recreating your program using the pieces you mentioned… May 11, 2026 at 11:22 am

Related Questions

From my understanding of the CSS spec, a table above or below a paragraph
My understanding of Hibernate is that as objects are loaded from the DB they
From my understanding the XMPP protocol is based on an always-on connection where you
From my understanding, Lua is an embeddable scripting language that can execute methods on
I'm using TortoiseHg 0.5 (which includes Mercurial 1.0.2) on Vista64. My understanding from the
From my experience with OpenID , I see a number of significant downsides: Adds
From my small amount of experience, I've only used Ant as a build tool.
From my experiments, it does not appear to do so. If this is indeed
From my time working with Ruby On rails, there is a couple different packaged/projects
From my bash shell I would like to call a program n times with

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.