Hey all,
I have a small snippet of code that dynamially adds rows to a table. The hang I'm up having is in setting the class of each row so that the rows alternate color. here's the script:
++$x;
if($x % 3 == 1){
++$y;
}
if($y % 2 == 1) {
$row_style = "d0";
}else{
$row_style = "d1";
}
echo "<tr class='".$row_style."'>";
echo "<td valign='middle' width='200'>Cell Data Goes Here</td>";
if($x % 3 == 0){
echo "</tr>";
}
The problem is that it prints the row contents fine but will use d0 for the first 3 results, d1 for the next 3, and back and forth in groups of 3. Any Ideas?
TIA!