Created
December 3, 2010 14:04
-
-
Save lplume/726986 to your computer and use it in GitHub Desktop.
a way to alternate background HTML color in a dinamically generated list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$styler = true; | |
foreach($questions as $q) { | |
$color = ($styler) ? "#335533" : "#553355"; $styler = !$styler; | |
echo "<li style='background:$color;'>$q->text</li>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment