Hi,
What is the pretend rows for?
I think you should move the whole section
$remainder = $i % $total_colors;
$bgcolor= $colors[$remainder];
into the while statement. Before the while statement you set $i: $i=0
Leave the 'for ($i = 0; $i < $pretend_rows; $i++)
' out. Then rewrite it a bit, to something like:
$remainder = $i % $total_colors;
$bgcolor= $colors[$remainder];
$i++
Hope this helps.
J.