Click to See Complete Forum and Search --> : CSS double classing tables?


andy3109
12-21-2002, 12:30 AM
Can I do something like this?

table.top { background: black; color: white; width: 150px }
table.leftside { background: green; color: blue; width: 300px }

and then call:

<table class = "top"><tr><td>asdf</td></tr></table>
and
<table class = "leftside"><tr><td>asdf</td></tr></table>
and have them with their attributes?

Oh and another thing. I keep trying to change border thickness and color but it doesn't seem to want to work. I go like this:
table { border: 2px; border-color: white }
But nothing happeneds. Thanks in advance.
-andy

Grizzly
12-21-2002, 10:11 AM
You can create classes that you can apply to most anything using the following syntax:


.myClassName { color: #003399; }


You could then have:
<h2 class="myClassName">asd</h2>

or...

<td class="myClassName">

etc etc...

Concerning table borders, this resource (http://www.w3.org/TR/REC-CSS2/tables.html#borders) should help you out.