Do you have a dynamic number of rows that uses an iteration? If so, run a test if the index (or the count) of the iteration is even or odd. If even, make it the first color. If odd, make it the second color.
Danilo loves those layout tags so much he wrote an entire chapter on them! In Struts Recipes we have a recipe on how to extend the Iterate tag to allow you to alternate any number of colors.
It recipe 2.8 on p 80. Remember, Struts tags are meant to be extended. You can extend any tag in the library to do whatever you need them to do. This recipes shows you how to do that step-by-step.
I have some columns in table (I iterate for these columns) which must be in another color. How to go about this? example: out of 5 columns i have 2 columns with different color
Originally posted by Liz Brown: I have some columns in table (I iterate for these columns) which must be in another color. How to go about this? example: out of 5 columns i have 2 columns with different color
Did you read the the sample of chapter two of the book Struts Recipes that the author of that book mentioned above? As he said, recipe 2.8 on p80 of the book (which is p42 of the pdf) gives you about as good an explanation as you're likely to find. I suggest taking the author's advice and having a look at this.
permaculture is giving a gift to your future self. After reading this tiny ad:
Gift giving made easy with the permaculture playing cards