Alternate row color by $g rows
$x=10;
$g = 5; $color = array('RED','BLUE');
$kaler = 0;
for($i=0; $i echo "$i .... ";
if(!($i%$g)){
$kaler = ($kaler == 0) ? 1 : 0;
} echo $color[$kaler] ."
";
}
$x=10;
$g = 5; $color = array('RED','BLUE');
$kaler = 0;
for($i=0; $i echo "$i .... ";
if(!($i%$g)){
$kaler = ($kaler == 0) ? 1 : 0;
} echo $color[$kaler] ."
";
}