December 8th, 2002, 05:07 PM
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.
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, 06:14 PM
Bottom line: I don't think it's possible.
December 8th, 2002, 07:19 PM
December 8th, 2002, 09:26 PM
Ahh, so that's what that does. Changes the color a bit but that's no big deal. Thanks degsy
December 8th, 2002, 09:30 PM
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).