Code Library
Home Submit Free Hosting Link To Us Contacts

PHP Making gradient background color with tables

PHP Making gradient background color with tables PHP PHP Making gradient background color with tables Download (.zip)



<?
function convert($hex) {
  $p = explode(".", $hex);
  $c = dechex($p[0]);
  $c = "$c" . dechex($p[1]);
  $c = "$c" . dechex($p[2]);
  return "#$c";
}
echo "<TABLE cellSpacing=0 cellPadding=0 width=100%>";
for($i=0 ;$i<=255 ; $i = $i+4) {
  $color = "$i.0.0"; //use "$i.$i.$i" for white-gray colors
  $color = convert($color);
  echo "<TR><TD bgcolor=$color>&nbsp;";
}
echo "</TABLE>";
?>






Tatet