I have the following CSS code that adds 5 pixel to the right and left side of my table

table.class1 {
    padding 0px 5px 0px 5px;
}

It works Fire Fox, Chrome and Safari. But it does not work in IE7. The cellpadding attribute for the table element is set to zero in the HTML code.

Would this cause the padding to be set to zero and is there a way to override this for IE7?

  • It also does not work in IE8 Michael Kniskern over 6 years ago
  • Did the margin not work? What about Belinda's suggestion? div.wrap-table { padding: 0 5px 0 5px; } JohnB over 6 years ago

3 answers

1
point
This was chosen as the best answer

Use margin instead of padding

Answered over 6 years ago by poscaman
1
point

Old versions of IE don't support table padding unfortunately.

Putting a div around the table and giving it a padding can achieve a similar effect...

Answered over 6 years ago by Belinda Hadiwidjaja
0
points

It may be the obvious- your example is missing a colon after padding

table.class1 {

padding: 0px 5px 0px 5px;

}

Answered over 6 years ago by Sean Maher