View Full Version : CSS for table


Jrfan888
11-15-2003, 10:36 PM
Is there any way you can have two table attributes is your css? For example, have one table that has one set of attributes then have another table that has a different set?
-Thanks!

kicker91
11-16-2003, 12:46 AM
yep. you can do that with classes

.table1
{
blaaaaa...
}

and to put those attributes in a certain table, you just add class="table1" into the <table> tag :)

MaGiCSuN
11-16-2003, 01:44 PM
just a little note. If you have for example this:

.table1 { text-align: justify; color: #000000; font-family: verdana; }

then you got a big chance that inside the <tr><td> tags you see none of the changes. then you gotta change it to this:

.table1 tr, .table1 td { all stuff here }

normally you put td, tr { stuff here } but because you have a class and you watn that certain table to have that you have to put the class in front of the td and tr :)

Love,
Mirna

Jrfan888
11-18-2003, 11:33 PM
Thanks kicker91 and Mirna

But Im a little confused...

using Mirna's way ('cause it doesnt work with the .table1 class) where you put the .table1 tr, .table1 td in your table code? Does is go in the table tag or within the TR and TD tags?

kicker91
11-19-2003, 01:34 AM
mirna's basically saying that what you are changing might affect the TD or the TR. so you can just use .table1, but put class="table1" in the <tr> and/or <td> tag.

Jrfan888
11-21-2003, 12:27 AM
oh, yay! Thanks kicker91, it worked :)