foreach alternate like table |
[eluser]danmontgomery[/eluser]
You need to keep a counter, and check if that counter is even or odd. You can do this with modular division. Code: $count = 0; You can shorten this with the ternary operator: Code: $count = 0; You can also use the alternator() function in the string helper: http://ellislab.com/codeigniter/user-gui...elper.html Code: for ($i = 0; $i < 10; $i++) |
Messages In This Thread |
foreach alternate like table - by El Forum - 01-12-2011, 04:07 PM
foreach alternate like table - by El Forum - 01-12-2011, 04:11 PM
foreach alternate like table - by El Forum - 01-12-2011, 04:13 PM
foreach alternate like table - by El Forum - 01-12-2011, 04:17 PM
foreach alternate like table - by El Forum - 01-12-2011, 07:43 PM
foreach alternate like table - by El Forum - 01-13-2011, 07:51 AM
foreach alternate like table - by El Forum - 01-13-2011, 01:09 PM
|