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

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
User avatar
genestevo
Forum Members
Forum Members
Posts: 72
Joined: Thu Jan 26, 2012 11:50 am

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

Post 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.
Last edited by genestevo on Thu Feb 09, 2012 11:02 am, edited 1 time in total.
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

Re: Table doesn't display cellpadding or cellspacing propert

Post 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;
}
User avatar
genestevo
Forum Members
Forum Members
Posts: 72
Joined: Thu Jan 26, 2012 11:50 am

Re: Table doesn't display cellpadding or cellspacing propert

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Table doesn't display cellpadding or cellspacing propert

Post by Dr.CSS »

That can be put in any style sheet anywhere, but I would put it in the general layout style sheet...
User avatar
genestevo
Forum Members
Forum Members
Posts: 72
Joined: Thu Jan 26, 2012 11:50 am

Re: Table doesn't display cellpadding or cellspacing propert

Post 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.
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

Re: Table doesn't display cellpadding or cellspacing propert

Post 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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Table doesn't display cellpadding or cellspacing propert

Post by Dr.CSS »

I would use Form builder module and the CSS template, not tables...
User avatar
genestevo
Forum Members
Forum Members
Posts: 72
Joined: Thu Jan 26, 2012 11:50 am

Re: Table doesn't display cellpadding or cellspacing propert

Post 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.
Post Reply

Return to “Layout and Design (CSS & HTML)”