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 |
try something like
<style>td.blah{padding:0 15px;}</style> <td class="blah">my stuff</td> Problem is that IE will behave different to any other browser probably.... :rolleyes: |
I'll give it a try
|
didn't work
(I'm using firefox) |
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> |
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'.
|
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 ? |
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> 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. |
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? |
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* |
I use margin?
|
all sorted
I was defining a class for the table when I should've defined a class for the <td> Firefox permitted my mistake, but IE didn't |
All times are GMT +1. The time now is 05:29 AM. |
© 2024 MH Sub I, LLC dba Internet Brands