Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Shading on a dynamic table (file included)

Avatar

Level 1

Hello!

I have a dynamic table with a repeating "section" (which consists of Row1 and Row2). Each "section" needs to alternate a different color. I tried the "alternating shading" checkbox in the object pallette but it is not working the way I need it to so I am looking to see if this can be done in code. Not trying to make the "rows" alternate. I need the "sections" to alternate. I did research and couldn't really find anything to help me with.

My colors:

First: 255, 255, 242

Second: 236,245,255

Here is the File:

https://files.acrobat.com/preview/592e1cb8-a0de-4337-a323-321dd66ba261

Thanks in advance!!

1 Accepted Solution

Avatar

Correct answer by
Level 8

You can try putting this script in the layout:ready event of both of your rows:

if (this.parent.index % 2 == 0)

          this.fillColor = "255, 255, 242";

else

          this.fillColor = "236,245,255";

Kyle

View solution in original post

2 Replies

Avatar

Correct answer by
Level 8

You can try putting this script in the layout:ready event of both of your rows:

if (this.parent.index % 2 == 0)

          this.fillColor = "255, 255, 242";

else

          this.fillColor = "236,245,255";

Kyle

Avatar

Level 1

Wow! Thanks Kyle! That worked perfectly! I appreciate your help very much!