View Full Version : One color for all cells


willworkforchoc
06-07-2003, 06:56 PM
Is there a code that puts the same color in every cell without having to write it with each individual cell?

Dude128
06-07-2003, 07:56 PM
just put the bgcolor property in the <table> tag, or if you want it by row, put it in the <tr> tag:

<table bgcolor="######">

or

<tr bgcolor="######">

pb&j
06-08-2003, 05:01 AM
or use some css?

<style type="text/css">
td {
background-color: #ff0000;
color: #0000ff;
}
</style>

that will apply to all td tags automatically now. if you want to apply it to specific places (either in the full table or tr like previously suggested) then my example in a class and add it in.

<style type="text/css">
.example {
background-color: #ff0000;
color: #0000ff;
}
</style>

then in your tag...

<table class="example">

or in the tr one...

<tr class="example">

or just to affect a single td area...

<td class="example">

willworkforchoc
06-08-2003, 03:19 PM
It worked using <table bgcolor...> however, I lost all my cell and border lines. Any suggestions?

Thanks