Web Hosting Talk







View Full Version : Cell Padding?


sabian1982
01-05-2006, 04:56 AM
Ive got cell padding on my tables on the site im working on, looks great in IE but in other browsers the cell padding seems to cause some problems?

ive tried using CSS

padding: 4px, 4px, 4px, 4px;

in an attempt to solve the problem but that doesnt seem to work at all!

If i dont get many suggestions ill try and post a link to an example so you can see whats going wrong!

Suggestions?

the_pm
01-05-2006, 09:57 AM
Get rid of those commas. Or better yet, since all four sides are the same, just make it - padding:4px;

That'll work.

sabian1982
01-05-2006, 09:59 AM
im pretty sure i tried that but ill give it ago!!! cheers!

NateD
01-07-2006, 05:43 AM
It depends what you're exactly trying to do. To have the cells within the table to have 4px padding just add to <table ... >, cellpadding=4.

To have padding _outside_ the table of 4px, ie you want the table to be 4 pixels away from all other elements on the page instead add this


<style>

.mytable {
margin: 4px;
}

</style>

<table class="mytable>...</table>


From my experience margin works both on IE and FireFox, padding will only work on IE.