[css-d] Tables, borders, cellspacing, cellpadding and CSS

2007-12-29 Thread Aaron Gray
Hi,

I am having problems with tables, basically I want to do all formatting in CSS 
but am having problems knowing how to do cellspacing and cellpadding table 
attributes in CSS.

At the moment I have :-

table {
border: 1px solid black;
}
td  {
border: 1px solid black;
}
th  {
border: 1px solid black;
}

and

table cellspacing=0 cellpadding=2
...
/table

How do I do this all in CSS ?

Many thanks in advance,

Aaron
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Tables, borders, cellspacing, cellpadding and CSS

2007-12-29 Thread Rafael
Aaron Gray wrote:
 Hi,

 I am having problems with tables, basically I want to do all formatting in 
 CSS but am having problems knowing how to do cellspacing and cellpadding 
 table attributes in CSS.

 At the moment I have :-

 table {
 border: 1px solid black;
 }
 td  {
 border: 1px solid black;
 }
 th  {
 border: 1px solid black;
 }

 and

 table cellspacing=0 cellpadding=2
 ...
 /table

 How do I do this all in CSS ?
   
Try this...
table,
th,
td {
  border: 1px solid black;
}
table {
  border-collapse: collapse;
}
th,
td {
  padding: 2px;
}

In IE, though, cellspacing has priority over border-collapse / 
border-spacing (so don't use it).

Rafael

Ref.: http://www.w3.org/TR/REC-CSS2/tables.html#borders
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/