html - Padding table with CSS doesn't work on IE -
this not working on ie:
<table style="padding:5px">...</table>
however works on opera.
is there workaround?
the earlier css specs (which ie6 follows -- , use word "follows" loosely) not clear padding defined on table should mean. ie6, naturally, decided interpret differently every other browser, ignoring padding. other browsers decided render adding spacing between table border , outermost cells, without affecting spacing inside cells, or between internal cells. time ie7 came out, specs had cleared work other browsers, ie6 still has problem, ignores padding.
the best solution avoid putting padding on table, instead surrounding div, , putting padding there.
<div style="padding: 5px;"> <table...> </table> </div>
of course, if want cell spacing or cell padding (as opposed padding on table), should use cellspacing
or cellpadding
attributes (even if don't want these, @ least need cellspacing="0"
avoid separate issue ie6 table rendering).
also, inline styles here demo purposes; using css classes considered better practice.
Comments
Post a Comment