Jump to content

Alternating table colours


joecooper

Recommended Posts

Check for odd/even row numbers

[code]$count = 0;

while (.....) {


          $bg = ($count++ % 2) ? '#EEEEEE' : '#CCCCCC';

          echo "<TR style='background-color: $bg'>\n";

                # cell data here

          echo "</TR>\n";
}[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.