Help - Search - Members - Calendar
Full Version: tables and cell padding
Forums > Resource Center > Webmasters' Corner > Webmasters' Corner Resolved Topics
mona lisa
Is there a way I can modify the cellpadding of a table using CSS? When I use the following, there is too much space from the top and bottom. Cellpadding apparently affects all four sides for each cell of the table.
CODE
<table align="middle" width="716" height="500" background="images/template_middle.png" border="0" cellspacing="0" cellpadding="17">

I want to squish it as shown here:


I have the whole thing in a table so that I can use an autostretching table with a repeating vertical background.

I tried using CSS but it didn't exactly work out.
CODE
td.content {
font-family: Tahoma, Verdana, Sans-serif;
font-size: 13px;
color: #000000;
cellpadding-left:11px;
cellpadding-top:5px;
cellpadding-right:11px;
cellpadding-bottom:5px; }
mipadi
Just use the "padding" attribute in cells. Something like this should work:
CODE
TD {padding:5px 11px;}

Of course, adjust it to your own CSS by adding other desired attributes and the correct CSS selector (.content in your example).
mona lisa
Wow. That was so simple. pinch.gif But it worked! Thank you! happy.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.