Page 1 of 1

[SOLVED] Table doesn't display padding or spacing properties

Posted: Tue Feb 07, 2012 11:03 am
by genestevo
CMSMS 1.10.3 PHP 5.2.17 Mysql 5.0.92 Apache/2.2.21 Linux

Hi Guys,
I have an e-mail form built around a table at:
http://historypoints.org/index.php?page=feedback-2
The problem is that the cellpadding or spacing values aren't being applied.
Is this something to do with php or is there something inherently wrong with my code?
Should I be using transparent gifs to force spacing?
Cheers,
Gene Stevo.

Re: Table doesn't display cellpadding or cellspacing propert

Posted: Tue Feb 07, 2012 2:17 pm
by JimboDavies
Hi Gene Stevo,

Instead of setting the cellpadding and cellspacing in your HTML, you can do it in your CSS.

Something like:

Code: Select all

#form_container {
border-spacing: 10px;
}
#form_container td {
padding: 10px;
}

Re: Table doesn't display cellpadding or cellspacing propert

Posted: Wed Feb 08, 2012 11:42 am
by genestevo
Hi Jimbo,
Thanks for the tip. Sorry to appear a bit thick though but I can't work out which style sheet to paste the supplied rules into.
I've tried numerous options but no luck yet.
The template I'm using is "Top simple navigation + left subnavigation + 1 column"
Any idea which style sheet I should be editing and is the position in the sheet critical?
Thanks again,
Gene Stevo

Re: Table doesn't display cellpadding or cellspacing propert

Posted: Wed Feb 08, 2012 4:11 pm
by Dr.CSS
That can be put in any style sheet anywhere, but I would put it in the general layout style sheet...

Re: Table doesn't display cellpadding or cellspacing propert

Posted: Wed Feb 08, 2012 9:12 pm
by genestevo
Hi Folks,
I've had another (several) go at trying to get css to work without success.
I've put it in the style sheet for "Layout: Left sidebar + 1 column" as shown below:
/* browsers interpret margin and padding a little differently, we'll remove all default padding and margins and set them later on */
* {
margin: 0;
padding: 0;
}
/*Set initial font styles*/
body {
text-align: left;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 75.01%;
line-height: 1em;
}
#form_container {
border-spacing: 10px;
}
#form_container td {
padding: 10px;
}


Still no joy. I've put a dummy copy of the form and a stylesheet online at:
http://www.historypoints.org/historypoi ... _form.html and it all works fine there.
I've cleared the cache repeatedly after each trial and nothing seems to work.

As an aside, using IE there is no gap between right hand border of the left navbar and the left side of the content border (at the top anyway).
Does this suggest I've broken something somewhere along the way? Not an issue with FF; Opera; Chrome or Safari.

Re: Table doesn't display cellpadding or cellspacing propert

Posted: Wed Feb 08, 2012 9:51 pm
by JimboDavies
It's a problem with how Internet Explorer interprets (or doesn't...) border-spacing.

See the article here for more info: http://vacskamati.blogspot.com/2007/03/eliminating-cellspacing-and-cellpadding.html.

As your table doesn't have a (visible) border, you're best just increasing the padding in the cells (padded cells?!?) and ignoring border-spacing I would suggest.

Re: Table doesn't display cellpadding or cellspacing propert

Posted: Wed Feb 08, 2012 10:07 pm
by Dr.CSS
I would use Form builder module and the CSS template, not tables...

Re: Table doesn't display cellpadding or cellspacing propert

Posted: Thu Feb 09, 2012 11:01 am
by genestevo
Thanks for the links, help and advice guys.

My edits to existing CSS don't want to show. Perhaps it's a precedence issue?

Guess I should read a bit more of TFM before I break something else.

Next time, now I'm aware of it's existence, I'll try using the supplied Form module.

Thanks again for all you help.
Cheers,
Gene Stevo.