The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Web Design
> CSS Help
|
CSS to control CELLSPACING in tables
Discuss CSS to control CELLSPACING in tables in the CSS Help forum on Dev Shed. CSS to control CELLSPACING in tables Cascading Style Sheets (CSS) forum discussing all levels of CSS, including CSS1, CSS2 and CSS Positioning. CSS provides a robust way of applying standardized design concepts to your web pages.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

December 8th, 2002, 04:07 PM
|
 |
Wiser? Not exactly.
|
|
Join Date: May 2001
Location: Bonita Springs, FL
|
|
|
CSS to control CELLSPACING in tables
I'm wondering if there is any CSS element that can control the cellspacing attribute of a table. I'm making a PHP script that will output tables to show some information, and the output will be put into a template. Inorder to allow people to control the looks of what my script makes, i've been giving everything an ID. The only thing so that that I havn't been able to do, is set the table's cellspacing attribute to 0 so that there is no space between the borders.
Here is a sample page of that it will currently do as apposed to what I want it to do.
http://kicken.mine.nu:8008/extras/spacing.html
In the second table, I set the cellspacing to 0 so you can see, but I want to be able to use CSS to do that.
Anyone know of any property(margin: and padding: don't work, tried both) that I may be looking for?
|

December 8th, 2002, 05:14 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Location: Norwich, UK
Posts: 53
Time spent in forums: 9 h 1 m 53 sec
Reputation Power: 11
|
|
|
Bottom line: I don't think it's possible.
I wanted to set cellspacing using CSS a while back, after some extensive testing and trawling through the CSS2 specification a few times I came up with nothing. In the end I had to manipulate the table's cellSpacing property via JavaScript. I can't help but feel that I missed something though, why on Earth it wouldn't be available is beyond me...
|

December 8th, 2002, 06:19 PM
|
|
|
|

December 8th, 2002, 08:26 PM
|
 |
Wiser? Not exactly.
|
|
Join Date: May 2001
Location: Bonita Springs, FL
|
|
|
Ahh, so that's what that does. Changes the color a bit but that's no big deal. Thanks degsy
|

December 8th, 2002, 08:30 PM
|
|
Senior Citizen
|
|
Join Date: Jan 2001
Location: leftcoast
Posts: 2,019
Time spent in forums: < 1 sec
Reputation Power: 15
|
|
|
border-collapse is crucial here - but cellspacing is done to individual tds using margin, and cellpadding uses, hem, padding, also applied to the cell. If you apply them to the table element, the entire table gets spaced/padded (as a block).
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|