View Full Version : Cellpadding


Neptune
02-01-2003, 06:08 PM
Can I have cellpadding in certain cells without having it all over? If so, how? I tried doing this, <td valign="top" bgcolor="#543F44" cellpadding="7"> but it didn't work :(

alkaline39
02-01-2003, 09:37 PM
cellpadding and cellspacing can only be used for the table tag

but u can always nest a table inside a td tag

ie:

...
...
...
<td>

<table cellpadding= "7">
<tr>
<td>
this is a nested table
</td>
</tr>
</table>

</td>

Neptune
02-01-2003, 10:46 PM
I tried it and it sort of made it into a new table.
Here's the link (http://www.geocities.com/popular_yak//rain.html). See how the words are too close to the border? Do you know a way I can fix it without making it a different table?

Alcy
02-01-2003, 10:46 PM
You can use CSS as well :)

<td style="padding:#px;">
</td>

Or you can even specify different values for each side of the cell.

<td style="padding-left:#px; padding-top:#px; padding-right:#px; padding-bottom:#px;">
</td>

Neptune
02-01-2003, 11:07 PM
My problem is not that I want all my tables the same. If you look at my page, I have 3 cells. The top one has an image in it, and if I add any cellpadding it messes up my image and the way it fits. But if I don't, my words are stupidly close to the border. Any way to fix it?

Alcy
02-01-2003, 11:29 PM
The one I posted above will do it - I use it all the time :).

In each cell you want the padding to appear, just add style="padding:5px;" or whatever number you'd like.

Neptune
02-01-2003, 11:31 PM
(Thanks! I already posted this, so I'll let it be because I'm curious and it'd be nice to know because one cell likes to hog all the room)
Is there anyway to set margins inside the cell? That would make things a lot easier.

Edit: Wouldn't that make them all the same?