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 3757170
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:57:54+00:00 2026-05-19T09:57:54+00:00

The following html works as expected apart from margin-top being completely ignored by table

  • 0

The following html works as expected apart from margin-top being completely ignored by table row div. And I can’t figure out why.

<div class='table'>

  <div class='margin-top5 row user' id='user_113'>
    <div class='cell left avatar margin-right5'><img alt="Blank_avatar_thumb" src="/images/blank_avatar_thumb.png?1295354025" /></div>
    <div class='cell left'>
      <div class='bold'><a href="/voisins/113">Dandre</a></div>
      <div class='small of_hidden'>toothpicking, veryveryveryveeerrrryyyyyylooooooooong, kidnapping...</div>
    </div>
    <div class='cell right'>42</div>

    <div class='clear'></div>
  </div>
  /* more rows */
</div>

css:

div.table {
  display: table;
  width: 100%;
}
div.row {
  display: table-row;
}
div.cell {
  display: table-cell;
}
div.left {
  float: left;
}
div.right {
  float: right;
}
div.clear {
  clear: both;
}
.avatar {
  vertical-align: middle;
}
.margin-top5 {
  margin-top: 5px;
}
.margin-right5 {
  margin-right: 5px;
}
.bold {
  font-weight: bold;
}
.of_hidden {
  overflow: hidden;
}
.small {
  font-size: 0.8em;
}
body, p, ol, ul, td {
  font-family: verdana, arial, helvetica, sans-serif;
  font-size: 13px;
  line-height: 18px;
}

EDIT:

If I remove .row class from row div, it starts picking up margin-top.

  • 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. Editorial Team
    Editorial Team
    2026-05-19T09:57:55+00:00Added an answer on May 19, 2026 at 9:57 am

    This is the cullprit: display: table-row;
    You’re telling the div to behave like a tr, tr‘s don’t have a margin… or padding.

    You can apply a padding to a td, but not a margin.

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

Sidebar

Related Questions

It seems that the following piece of HTML is ignored in IE7 but works
The following Html works great for me in FireFox or IE7/8 (with or without
The following html code works in Firefox, but for some reason fails in IE
I'm using the following html to load dojo from Google's hosting. <script src=http://www.google.com/jsapi></script> <script
With valid HTML the following finds the object as expected in all browsers but
The following code works as expected in IE8 and Safari4, but not in Firefox3.6
The following HTML looks as required in Firefox 2 & 3 and IE7. The
I have the following html.erb code that I'm looking to move to Haml: <span
I have the following HTML <select> element: <select id=leaveCode name=leaveCode> <option value=10>Annual Leave</option> <option
I have the following HTML (note the CSS making the background black and text

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.