tenriquez199
asked on
how can i set gradient color at a html table
hi
how can i set a color bakcground gradient to a table?...this is my code:
<table width="953" height="316" border="0" bgcolor="#CCCCCC" hspace="20" align="center" class="bordesred">
<tr>
<td width="42" >
<p></td >
<td width="352"><p><span title="mouse over description here">normal text</p> </td><td width="42"></td>
<td width="499" rowspan="4"> &n bsp; &nbs p; &n bsp; &nbs p; &n bsp; </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
index.html
how can i set a color bakcground gradient to a table?...this is my code:
<table width="953" height="316" border="0" bgcolor="#CCCCCC" hspace="20" align="center" class="bordesred">
<tr>
<td width="42" >
<p></td >
<td width="352"><p><span title="mouse over description here">normal text</p> </td><td width="42"></td>
<td width="499" rowspan="4"> &n
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
index.html
http://gradients.glrzad.com/
Something like this perhaps:
<table width="953" height="316" border="0" bgcolor="#CCCCCC" hspace="20" align="center" class="bordesred" style="filter:progid:DXIma geTransfor m.Microsof t.Gradient (endColors tr='#C0CFE 2', startColorstr='#FFFFFF', gradientType='0');" >
<tr>
<td width="42" >
<p></td >
<td width="352"><p><span title="mouse over description here">normal text</p> </td><td width="42"></td>
<td width="499" rowspan="4"> &n bsp; &nbs p; &n bsp; &nbs p; &n bsp; </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
http://www.web-source.net/html_background_gradient.htm
<table width="953" height="316" border="0" bgcolor="#CCCCCC" hspace="20" align="center" class="bordesred" style="filter:progid:DXIma
<tr>
<td width="42" >
<p></td >
<td width="352"><p><span title="mouse over description here">normal text</p> </td><td width="42"></td>
<td width="499" rowspan="4"> &n
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
http://www.web-source.net/html_background_gradient.htm
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you could apply it directly to the TABLE element, or wrap it in a div. Personally, I'd wrap it in a div tag, and style the div like so:
That way if you have multiple tables, you retain the ability to style them separately, which could be useful.
CSS3 PIE is very useful for older IE browsers if you want to support them. Add the following to the above after downloading the package:
#div.table {behavior: url(path/to/PIE.htc);
/* fallback for very old browsers */
background-color: #810303;
/* Safari 4-5, Chrome 1-9 */
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#970101), to(#5f0202));
/* Safari 5.1, Chrome 10+ */
background: -webkit-linear-gradient(to p, #970101, #5f0202);
/* Firefox 3.6+ */
background: -moz-linear-gradient(top, #970101, #5f0202);
/* IE 10 */
background: -ms-linear-gradient(top, #970101, #5f0202);
/* Opera 11.10+ */
background: -o-linear-gradient(top, #970101, #5f0202);
/* basic fallback */
linear-gradient(top, #970101, #5f0202);
/* PIE fallback */
-pie-background:
}
Hope that helps!
That way if you have multiple tables, you retain the ability to style them separately, which could be useful.
#div.table {
/* fallback for very old browsers */
background-color: #810303;
/* Safari 4-5, Chrome 1-9 */
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#970101), to(#5f0202));
/* Safari 5.1, Chrome 10+ */
background: -webkit-linear-gradient(top, #970101, #5f0202);
/* Firefox 3.6+ */
background: -moz-linear-gradient(top, #970101, #5f0202);
/* IE 10 */
background: -ms-linear-gradient(top, #970101, #5f0202);
/* Opera 11.10+ */
background: -o-linear-gradient(top, #970101, #5f0202);
/* basic fallback */
linear-gradient(top, #970101, #5f0202);
}
CSS3 PIE is very useful for older IE browsers if you want to support them. Add the following to the above after downloading the package:
#div.table {behavior: url(path/to/PIE.htc);
/* fallback for very old browsers */
background-color: #810303;
/* Safari 4-5, Chrome 1-9 */
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#970101), to(#5f0202));
/* Safari 5.1, Chrome 10+ */
background: -webkit-linear-gradient(to
/* Firefox 3.6+ */
background: -moz-linear-gradient(top, #970101, #5f0202);
/* IE 10 */
background: -ms-linear-gradient(top, #970101, #5f0202);
/* Opera 11.10+ */
background: -o-linear-gradient(top, #970101, #5f0202);
/* basic fallback */
linear-gradient(top, #970101, #5f0202);
/* PIE fallback */
-pie-background:
}
Hope that helps!
http://css3pie.com/documentation/supported-css3-features/#pie-background