| | |||||
| ||||||||
| CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: May 2003
Posts: 2,187
![]() ![]() ![]() | the simple way to do alternate row colors everytime ive looked about at alternate row colors seen some long code which just isnt nesacary imo heres the easyway, 3 variables, 1 if statement which can be nested in an iffstament but heres the code PHP Code: PHP Code: http://www.crooty.co.uk/scripts/alternaterows.php it basically says if bgcolor equals bgcolor1 set bgcolor as bgcolor 2 and then it swaps it around and does it every time
Last edited by adam_uk; 11-23-2004 at 03:34 PM.
|
| |
| | #2 (permalink) |
| Senior Member Join Date: Aug 2002
Posts: 1,255
![]() ![]() | You can also write that like below to save yourself from writing the same thing twice and save a little coding. The ternary operator comes in handy for code like that. ![]() PHP Code: |
| |
| | #3 (permalink) | ||||
| Account Closed Join Date: May 2004 Location: /etc/passwd
Posts: 2,178
![]() ![]() ![]() ![]() ![]() ![]() |
i agree, this is the easiest way here | ||||
| |