Pieter
Pieter

Reputation: 32805

IE8 doesn't respect table padding

This is a screenshot of a table in Chrome 5.

Chrome

The same table rendered in IE8:

IE8

You can view the page here: http://labs.pieterdedecker.be/vspwpg/?page_id=96

This CSS rule adds the padding that IE8 won't respect: td#content table.subitems { padding: 5px; }

Upvotes: 4

Views: 3534

Answers (2)

Josh
Josh

Reputation: 53

I ran into the same problem with my site. The class was applied to the <td> tag but its padding was not showing up. Then I declared the padding inline, and it showed up fine. I nearly put a fist through my monitor, but when I realized that would hurt me and not IE, I refrained. It's not pretty, but it works.

<td class="doesntMatterBecauseIEHatesYou" style="padding:10px;">Horray, IE doesn't hate you anymore. But you still hate IE.</td>

Upvotes: 0

meder omuraliev
meder omuraliev

Reputation: 186742

Try adding the padding to the td/th elements under the table, not the table itself. The table cells / headings get zeroed out by *{margin:0;padding:0;} as well, so you have to explicitly specify.

Edit: If you don't mean to put padding on every table cell/heading then try a margin on the table or padding on a table wrapper div.

Upvotes: 6

Related Questions