Search code examples
javahtmlclojuretemplate-engineenlive

How set a table row's attribute class dynamically with clojure/enlive?


I have created a table using enlive template engine. what I have done, is create a singe table row and repeated that row up to the no of row needed dynamically. But, I have some problems update the each row's attribute class.

How can I set the class attribute for every table row dynamically, say even odd manner?


Solution

  • There is a thread on the enlive mailing list where Christophe Grand explains how to do this.

    I also share the feeling that if you can use nth-child selector it is way cleaner.