Welcome Guest, Not a member yet? Register   Sign In
Alternate row colours
#4

[eluser]n0xie[/eluser]
Semantically speaking, imho the table element is correct if you are talking about 'rows' or in your case it should be a list. But to each his own.

Code:
<?php
$zebra = NULL;
foreach($list as $value):
  $zebra = (is_null($zebra)) ? 'someclassname' : NULL;
  echo "<div class='$zebra'>some stuff here</div>";
endforeach;
?&gt;


Messages In This Thread
Alternate row colours - by El Forum - 01-07-2010, 07:53 AM
Alternate row colours - by El Forum - 01-07-2010, 07:55 AM
Alternate row colours - by El Forum - 01-07-2010, 07:59 AM
Alternate row colours - by El Forum - 01-07-2010, 08:06 AM
Alternate row colours - by El Forum - 01-07-2010, 08:12 AM
Alternate row colours - by El Forum - 01-07-2010, 08:13 AM
Alternate row colours - by El Forum - 01-07-2010, 08:14 AM
Alternate row colours - by El Forum - 01-07-2010, 08:35 AM
Alternate row colours - by El Forum - 01-08-2010, 04:02 AM
Alternate row colours - by El Forum - 01-08-2010, 07:51 AM
Alternate row colours - by El Forum - 01-08-2010, 08:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB