QuestionQ10
Scripting and AutomationA developer needs to create an HTML table whose rows alternate background colors between white and red. The developer does not know how many rows will be sent in each email, so they use a loop and assign the RowCount() of the table rows to the variable @numerator.
What AMPscript logic should be used within the loop to determine the background color for each table row?
- A %%[ IF MOD(@numerator,2) = 1 THEN SET @color = 'Red' ELSE SET @color = 'White' ENDIF ]%%
- B %%[ IF SUBSTRING(DIVIDE(@numerator,2),l) = 1 THEN SET @color = 'Red' ELSE SET @color = 'White' ENDIF ]%%
- C %%[ IF @numerator/2 = 1 THEN SET @color = 'Red' ELSE SET @color = 'White' ENDIF ]%%
Community Discussion