HTML: Use CSS to change only left and right CELL PADDING ?
#1
HTML: Use CSS to change only left and right CELL PADDING ?
Is it possible to adjust specifically the left and right side of the CELL PADDING command using CSS ?
I need top and bottom to be 0 px
I need left and right to be 15 px
I need top and bottom to be 0 px
I need left and right to be 15 px
#5
try this
<table width="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="border-top-width: 0px; border-right-width: 15px; border-bottom-width: 0px;border-left-width: 15px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid;"> </td>
</tr>
</table>
<table width="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="border-top-width: 0px; border-right-width: 15px; border-bottom-width: 0px;border-left-width: 15px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid;"> </td>
</tr>
</table>
#6
Do you really need a table? You should try and use CSS where ever possible unless of course you are displaying tabulated data. You shouldn't use tables for layout. Can be tricky to get right and working across browsers but the code you are left with is smaller, cleaner and more 'valid'.
#7
Originally Posted by RichB
Do you really need a table? You should try and use CSS where ever possible unless of course you are displaying tabulated data. You shouldn't use tables for layout. Can be tricky to get right and working across browsers but the code you are left with is smaller, cleaner and more 'valid'.
Is it frowned up to use tables for general layout and alignment ?
Trending Topics
#8
Originally Posted by mykp
try this
<table width="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="border-top-width: 0px; border-right-width: 15px; border-bottom-width: 0px;border-left-width: 15px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid;"> </td>
</tr>
</table>
<table width="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="border-top-width: 0px; border-right-width: 15px; border-bottom-width: 0px;border-left-width: 15px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid;"> </td>
</tr>
</table>
I should add, I'm doing this from CSS and NOT directly directly in the code as you show above. I like the CSS approach as it allows me to apply global changes instantly.
Last edited by spectrum48k; 15 August 2006 at 06:31 PM.
#9
It does for me!(Both mac and pc)
Are you using IE on a Mac or PC? Mac IE is really really bad! IE on the PC is just really bad...
Care to give us more of the HTML or the URL so we can test/see it?
Are you using IE on a Mac or PC? Mac IE is really really bad! IE on the PC is just really bad...
Care to give us more of the HTML or the URL so we can test/see it?
Last edited by RichB; 15 August 2006 at 06:38 PM.
#10
HTML:
<table class="padded_leftright" width="750" align="center">
<tr>
<td><hr color="#ffcc00" size="3" width=100%></td>
</tr>
</table>
CSS:
table.padded_leftright {
vertical-align:top;
background-color:#000000;
padding-top: 6px;
padding-right: 20px;
padding-bottom: 6px;
padding-left: 20px;
border: 0px;
}
Just noticed your code is different, D'OH!
*scrambles off to try your code*
<table class="padded_leftright" width="750" align="center">
<tr>
<td><hr color="#ffcc00" size="3" width=100%></td>
</tr>
</table>
CSS:
table.padded_leftright {
vertical-align:top;
background-color:#000000;
padding-top: 6px;
padding-right: 20px;
padding-bottom: 6px;
padding-left: 20px;
border: 0px;
}
Just noticed your code is different, D'OH!
*scrambles off to try your code*
Last edited by spectrum48k; 15 August 2006 at 06:44 PM.
Thread
Thread Starter
Forum
Replies
Last Post
Mattybr5@MB Developments
Full Cars Breaking For Spares
28
28 December 2015 11:07 PM