check out css style sheets
the styling is all done in html -nothing to do with the php as such
for alternating lines set a counter variable before the script: $num=0;
check $num value like this
if ($num%2==1) { colour me blue } else { colour me green }
the % operator tells you the remainder of $num divided by, in this case, 2 so its either 1 or 0
then at end of the while statement increment $num like :
$num++;
so $num adds up the rows