Forum Moderators: open
How can I set cell padding **ONLY** for the right and left sides of the table? I don't want cell padding at the top and bottom of the table.
Using CSS....
You can try:
<body style="margin-top:0;padding-top:0;">
...
Or if you have an external stylesheet:
body {
margin-top:0;
padding-top:0;
} I'm not too familiar with DreamWeaver to be honest, but padding always comes in all four flavours... top/right/bottom/left....
Set all edges to 20px padding:
padding:20px;
To explicilty set it for each side:
padding-top:5px;
padding-right:10px;
padding-bottom:15px;
padding-left:20px;
Which is the same as (shorthand notation):
padding:5px 10px 15px 20px;
You can also set the same for top/bottom left/right:
padding:5px 20px;
On a table cell (<td>) - no padding top/bottom, only left/right padding:
td {
padding:0 20px;
} Note, you can have padding on a <table>, as well as a <td> (table cell).
Hope that helps.
<body style="margin-top:0;padding-top:0;">
didn't work for me since I had a class (in external stylesheet) named body.
I ended up using...
p {
padding-right:20px;
padding-left:20px;
}
in the stylesheet, and added
table style= "padding-top: 0; padding-bottom: 0" to the HTML.
That worked extremely well. Thanks!