Created
December 4, 2022 14:57
-
-
Save nosajhpled/69e293c977ed2f16db6d459c57035113 to your computer and use it in GitHub Desktop.
PHP : Alternating Row Color in a HTML Table
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
.alt { background-color:#F0F2FF; } | |
echo '<tr '.(!isset($alt) ? $alt = 0 : $alt++ % 2 == 0 ? 'class="alt"' : '').'>'; | |
#PHP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment