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

  • SEARCH
  • Home
  • 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 77k
  • Answers 77k
  • 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 Maybe it would make sense to break the interface inheritance… May 11, 2026 at 3:17 pm
  • added an answer DataContext is just a handy way to pick up a… May 11, 2026 at 3:17 pm
  • added an answer json is simplejson, added to the stdlib. But since json… May 11, 2026 at 3:17 pm

Related Questions

When my browser renders the following test case, there's a gap below the image.
I'm currently building a Spring MVC application. I was looking to use JSP pages
Let me set the stage here. I'm a very junior developer who's recently made
My understanding is that there are 3 types of stylesheet: Defined by the page

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.