View Full Version : Changing tables with CSS?


lovely_sugar102
03-30-2003, 01:02 PM
Is there a way that I can change all of the tables on one page, using CSS? Like, in the CSS, it tells the tables the colors they should be (bg, border, etc.)? THANKS :)

pb&j
03-30-2003, 01:42 PM
yes. css may be applied to practially any html object.

table {css coding here;}

in some cases you may have to apply the styles to the TD areas instead (or as well as).

td {css coding here;}

lovely_sugar102
03-30-2003, 03:15 PM
Actually, I really need it to be in ONE css code, not several INSIDE each table.

Example:

(top part of css code)
(table colors)
(bottom part of css code)

<table>
<tr><td>
text here
</tr></td>
</table>

so then, the table border will be pink, and the bg blue, or whatever. Is that possible?

Or maybe I am getting what you said wrong.... What do you mean? Can you give me the CSS example? THANKS :)

pb&j
03-30-2003, 03:35 PM
table {
border-color:pink;
background-color:blue;
}

that would then affect all tables in your page.

lovely_sugar102
03-30-2003, 03:48 PM
Okay, that didn't work for the border, because I don't know what to put for the WIDTH of the border. i tried this(along with the other part of the CSS):

table {
border:1;
border-color:pink;
background-color:blue;
}

but it didn't work. What's wrong? THANKS

lovely_sugar102
03-30-2003, 04:04 PM
Never mind! I figured it out! Thanks a TON for your help! :)