Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How we mix two color in a table for example from top red and from bottom yellow
Posted
Updated 1-Aug-20 17:01pm

I suspect you use CSS on a row by row basis to specify the color for each. Or you do a bitmap, one pixel wide, and tile it as a background. There is no HTML support for gradients.
 
Share this answer
 
Use CSS to style your table.
Use "background-color" property and assign different colors to different rows.
So something like:
<table>
<tr>
<td class="tdRed">&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
<tr>
<td class="tdYellow">&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</table>

The CSS will be:
.tdRed
{
background-color:Red;
}

.tdYellow
{
background-color:Yellow;
}

PS: I have intentionally checked 'Ignore HTML n text' so that you can see the 'nbsp' thing.
 
Share this answer
 
v2
Another option is to create a colour gradient and use it as an image.

This[^] is an option.
 
Share this answer
 
Comments
raju melveetilpurayil 18-Aug-10 4:02am    
I little late to post my answer. when I opened this tab there is no 3rd answer. I did post a different link but concept is same as yours. sorry for to refresh the window before post answer.
I think you looking for gradient check the below link will help you solve issue.
CSS Gradient background with out image in table[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900