26 Dec 2002 davidu   » (Journeyer)

deekayen: I agree with and appreciate what you wrote. As a side note, the example I gave was for creating alternating rows in a table (using PHP). I discovered a solution which is even better for this sort of "back and forth" type of coding. It's simply using $i%2 to alternate a class every other line. Then I just have two css styles which vary the color in the rows.

$i = 1;
foreach ($rows as $row) {
    echo '<tr class="row' . ($i % 2) . '">';
    // TD $row stuff.
    echo '</tr>';
    $i++;
}

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!