how do i set cellpadding+cellspacing in css?
...once i know the right css thing to set for it...if i put it in the body thing (like body {color: #123456}) will it change all the tables' cellpaddings and cellspacings?
thanx,
johnTable cellpadding and cellspacing are not CSS attributes, they are HTML attributes.
If you set "padding" in the BODY, a table will not inherit that style, anyway. You can set "padding" on the TD or the TH.
I'm not sure of the relationship of cellspacing and border-width + margin + padding, but I'm sure you could get it to look like you want it to look by playing with those style variables.thanx...i wasn't sure if it existed (i've never seen it)
i just thought it would help tidy up my code...i could get rid of all those long "cellpadding=0 cellspacing=0" attributes in the 3 tables i have
thanx again,
john<style type="text/css">
table
{
border-collapse: collapse;
}
td, th
{
margin: 0;
padding: 0;
}
</style>Thanx!
...i didn't know you could change multiple tag's css by using the comma *takes a note*
what's that collapse mumbo jumbo?
p.s. what's your signature supposed to mean?Id been looking for the solution posted by jeffmott for a while, it looks like the border-collapse function makes all the difference... just like the manual says
from <!-- w --><a class="postlink" href="http://www.w3.org/">www.w3.org/</a><!-- w -->
The various border properties apply to columns only if 'border-collapse' is set to 'collapse' on the table element. In that case, borders set on columns and column groups are input to the conflict resolution algorithm that selects the border styles at every cell edge.
This css made it for me (set cellpadding and cellspacing to 0 on all tables), whats the difference?
table {
border-collapse: collapse;
margin: 0;
}
...once i know the right css thing to set for it...if i put it in the body thing (like body {color: #123456}) will it change all the tables' cellpaddings and cellspacings?
thanx,
johnTable cellpadding and cellspacing are not CSS attributes, they are HTML attributes.
If you set "padding" in the BODY, a table will not inherit that style, anyway. You can set "padding" on the TD or the TH.
I'm not sure of the relationship of cellspacing and border-width + margin + padding, but I'm sure you could get it to look like you want it to look by playing with those style variables.thanx...i wasn't sure if it existed (i've never seen it)
i just thought it would help tidy up my code...i could get rid of all those long "cellpadding=0 cellspacing=0" attributes in the 3 tables i have
thanx again,
john<style type="text/css">
table
{
border-collapse: collapse;
}
td, th
{
margin: 0;
padding: 0;
}
</style>Thanx!
...i didn't know you could change multiple tag's css by using the comma *takes a note*
what's that collapse mumbo jumbo?
p.s. what's your signature supposed to mean?Id been looking for the solution posted by jeffmott for a while, it looks like the border-collapse function makes all the difference... just like the manual says
from <!-- w --><a class="postlink" href="http://www.w3.org/">www.w3.org/</a><!-- w -->
The various border properties apply to columns only if 'border-collapse' is set to 'collapse' on the table element. In that case, borders set on columns and column groups are input to the conflict resolution algorithm that selects the border styles at every cell edge.
This css made it for me (set cellpadding and cellspacing to 0 on all tables), whats the difference?
table {
border-collapse: collapse;
margin: 0;
}