Dieter Raber: Tabellen/Zeilen abwechselnd farbig darstellen

Beitrag lesen

Hallo Rony,

Viennamade war mit Modulo auf der richtigen Faehrte, alles was du jezt noch tun musst, ist eine CSS-Klasse mit dem namen ".distinct" zu basten, die die alternative Farbe enthaelt.

<?php
$i = 0;
do {
  $class = $i % 2 ? '' : ' class="distinct"';
  print '<table width="450" border="0" cellspacing="0" cellpadding="0">'
  if ($row_rs1['titel'] != "" ) {
    print '<tr' . $class . ">\n"
        . '<td width="293">' . $row_rs1['titel'] . "</td>\n"
        . '<td width="157">' . $row_rs1['erscheinungsjahr'] . "</td>\n"
        . "</tr>\n"
  }
  print "</table>\n";
$i++;
} while ($row_rs1 = mysql_fetch_assoc($rs1));
?>

Dieter