Reputation: 19
I have a large table, and need to change the background of a cell to be 1 to 6 color bands, like rectangle stacked on top of each other (and other information will appear within the cell). While this example is a table, I'm guessing this applies to any DIV. I'd like to be able (via javascript on the fly) grab the 'cellcontainer' DIV in the DOM and create children DIV's to create a banded background effect.
<table border=1 width=400 height=400>
<tr>
<td>
<div class="cellcontainer">
One
</div>
</td>
<td>Two</td>
</tr>
<tr>
<td>Three</td>
<td>Four</td>
</tr>
</table>
For this simple table, I'm trying to take the first cell (with div 'cellcontainer') and make the background three different colors, like light blue, yellow, and green. I've tried adding children divs with height=33%, and setting cellcontainer's style to relative and children divs to absolute, etc. but I haven't found the magic combination.
Upvotes: 0
Views: 796