/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$i = 0; foreach($rows as $row) { $class = ($i++ & 1) == 1 ? 'odd' : 'even'; echo '<tr>'; echo "<td class=\"{$class}\">{$row['name']}</td>"; echo "<td class=\"{$class}\">{$row['phone']}</td>"; echo '</tr>'; }
Comments
