I am using struts 1.1. I have an Arraylist on my formbean. Using logic:iterate tag, i am displaying the the contents of the Arraylist on the jsp. But at the same time, i need to show the alternate rows in different colors. e,g. First row (background) color should be in green, Second row (background) color should be in yellow, third row (background) color should be in green, and next row in yellow and so on.
I am using the mod function i.e counter%2 to identify odd row and even row using logic:equals tag, but this does not work.
How can i achieve the alternate colored row to diaplay my data in the list. Any help would be greatly appreciated.
posted 11 years ago
I also tried to implement doing the below, but it did not work. It just enters the notEqual condition. When i output the value of counterStr using out.println, it is displaying correctly - either 0 or 1
Thanks Sagar, but we are now allowed to have the css modified. I have to necessarily use the css class greenrow and yellowrow. If in your code, it accepts a counter.intValue() % 2, why is it not working when i use it in my logic equals tag ??