Author Topic: Change css class on every loop  (Read 2713 times)

0 Members and 1 Guest are viewing this topic.

Offline danf.1979

  • Newbie
  • *
  • Posts: 2
Change css class on every loop
on: Sat, 23. February 2008 - 20:32:46
Hi, is there any way I can manage to change colores for each row in a {tmpl_loop}? Im trying to switch colors in a table, but I cant think of another solution than to use {tmpl_if}, but that surely doesnt seem very motivating.

Offline ClausVB

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
    • Homepage: clausvb.de
Re: Change css class on every loop
Reply #1 on: Mon, 25. February 2008 - 19:05:58
You have to use TMPL_IF like

Code: [Select]
<tr style="background-color: <tmpl_if name=__EVEN__}#eeeeee<tmpl_else>#dcdcde</tmpl_if>;">
Example: Display data with changing row colors

Regards,
Claus