The following code will allow you to change colors every other row in PHP.
Add the following around the do { loop:
$cnt = 0;
do {
$color = ($cnt & 1)? "#F8F8F8" : "#FFFFFF";
$cnt++;
.
.
.
Add the following to the <tr> tag:
<tr style="background-color: <?php echo $color; ?>">
With this example, every other row will be a light grey color and the other row will be white. The first row starts off being white.
No comments:
Post a Comment