php give class to 3 div's then skip 3
<p>I have a table with a row of 3 div's then another row or 3 div's then another and then another. </p>

<p>But what I'm trying to achieve is to highlight every other row. And each row contains 3 div's.</p>

<p>So the first row will be <code>.mydiv .even</code> and then the <code>.even</code>'s will be grey. Then the next row will be <code>.mydiv .odd</code> and then the <code>.odd</code>'s will be white.</p>

<p>I am using this code from css-tricks.com <code>($xyz++%2)</code> to make every other div a different class.</p>

<p>All help is apreciated.</p>

<hr>

<p>This is my code</p>

<pre><code>$get_new_games = mysql_query("SELECT game_title,game_description,id from games ORDER BY added_date LIMIT 10");
while ($row = mysql_fetch_array($get_new_games)) {
$new_game_title = $row['game_title'];
$new_game_description = $row['game_description'];
$new_game_id = $row['id'];
$new_games_display .= '&lt;div class = "game_module class-'.($xyz++%2).'"&gt;&lt;img src = "game_thumbnails/'.$new_game_id.'/_thumb_100x100.png" class = "game_img"&gt;&lt;/div&gt;';
}
</code></pre>
