CSS-clearfix: Why using "table" for the "display"-property?

Viewed 2978

I'm using these code for making wrapper-elements containing their floated children (instead of collapsing):

.wrap:after {
  content: '';
  display: block;
  clear: both;
}

Now I have seen code in which table is used as the value for display.

It's said that this is for "to contain the top-margins of child elements".

Full article here: http://nicolasgallagher.com/micro-clearfix-hack/

I've tinkered around with both variations (block, table) but I couldn't find any difference.

Can someone provide an example which shows the difference between using block or table?

1 Answers
Related