...however, it works in Opera. Is there ...">

CSS fill table not working in IE

This does not work on my IE:

<table style="padding:5px">...</table> 

however, it works in Opera.

Is there a workaround?

+6
html css internet-explorer html-table padding
source share
4 answers

The earlier CSS specifications (which IE6 follows - and I use the word "should" loosely) are unclear which addition defined on the table should even mean. IE6, of course, decided to interpret it differently than any other browser, ignoring the indentation. Other browsers decided to do this by adding the distance between the table border and the outer cells, without affecting the spacing inside the cells or between the inner cells. By the time IE7 was released, specifications had been cleared to work like other browsers, but IE6 still had a problem when it simply ignored the add-on.

The best solution is not to place the add-on on your table, but instead surround its div and place the add-in there.

 <div style="padding: 5px;"> <table...> </table> </div> 

Of course, if you want this is the distance between the cells or the filling of the cells (as opposed to just filling in the table), then you should use the cellspacing or cellpadding attributes (even if you do not want this, you at least need cellspacing="0" to avoid another separate issue with rendering the IE6 table).

In addition, the inline styles here are for demonstration purposes; using css classes is generally considered best practice.

+17
source share

Have you tried using <table cellpadding="5"> ? IE has problems with some CSS style. In addition, your syntax is incorrect, you forgot the half-time.

0
source share

I would venture to suggest that something else is wrong in your code.

Padding works fine in IE:

http://jsbin.com/ewuho4/

0
source share

If you want to stick cells, use the cellular attribute (cellpadding = "X"), if you want to place a table, then this is inconvenient, given the structure, I recommend you put a margin if you need some space between this and everything else. Padding does not work on IE, although I am not a fan of IE, I do not blame him for it

0
source share

All Articles