return to tranceaddict TranceAddict Forums Archive > Archives > Classic old threads / Inactive Forums > Retired Forums > Frequently Asked Questions / Tutorials / How do I?

 
Web Development - CSS question...
View this Thread in Original format
Nell
I want all my tables in my html file to have 0 cellpadding and 0 cellspacing, so i would like to put it in my CSS file if possible to keep it neater.

i've tried...
quote:

table {
cellspacing: 0;
cellpadding: 0;
}

and
quote:

table {
cell-spacing: 0;
cell-padding: 0;
}


but no success.

is it possible? anyone know how? thanks!
Ek0nomik
table { border-spacing: 0px; }

or

table { border-collapse: collapse; }
ierxium
The style sheet equivalents of cellspacing and cellpadding are border-spacing and padding.

So it will be one of the following: table { border-spacing: 0px; } OR table { border-collapse: collapse; }
ierxium
quote:
Originally posted by Ek0nomik
table { border-spacing: 0px; }

or

table { border-collapse: collapse; }


Damn you!! :mad: :D
Nell
thanks guys, that's appreciated. i might have some more questions later if you're around.

actually...

can the alignment of a table be entered into CSS?

i tried

table {
align: center;
}

but that doesnt work. thanks again for the speedy reply! nice to know people actually browse this forum!
ierxium
quote:
Originally posted by Nell
actually...

can the alignment of a table be entered into CSS?

i tried

table {
align: center;
}

but that doesnt work. thanks again for the speedy reply! nice to know people actually browse this forum!


Are you trying to align the table or the content in it?

If you're talking about the content this will help...
Aligning content horizontally: text-align: center;
Aligning content vertically: vertical-align = center;
Nell
the table itself! i.e. the equiv of doing

table align="center" in html

but thanks on how to do that, that was my next question probably :)

are you on MSN at all? i could do with having you at my side! :D
if you are, i'm [email protected]

thanks again!
ierxium
I don't have messenger programs right now.

Check this link here: *** The information there is pretty straight forward. If you still have trouble PM me, I'll help if I can.
Nell
thanks mate!
Nell
i've just realised that i cant get the cell padding to be 0, it says on that link i can only do between 1-4. i presume there is no other way then? i guess i'll have to enter that one in the html!

itsTrueSonic
quote:
Originally posted by Nell
thanks guys, that's appreciated. i might have some more questions later if you're around.


haha .. i think swamper made the smart move by instead of accessing this through the main forum page, it is accessed through COR .. and it is at the top of the COR page .. therefore, it is easy to see if someone posted something new (yellow or gray) .. hahahha ...

but with the center thing .. sounds like you want to center the whole table .. what you can do, instead of using CSS, you can use the "center" HTML tag before you enter your table.

whoops never mind .. answered for you .. i miss everything .. hahahhaa ..
CLICK TO RETURN TO TOP OF PAGE
 
Privacy Statement