Alternate row shading | XM Community
Skip to main content
Solved

Alternate row shading

  • April 25, 2022
  • 5 replies
  • 588 views

Forum|alt.badge.img

Hi - could anyone help me with (light grey) shading for alternate rows on a side by side format?

Best answer by KMT

You're a genius Tom - thank you!

5 replies

Tom_1842
Level 8 ●●●●●●●●
Forum|alt.badge.img+28
  • Level 8 ●●●●●●●●
  • April 26, 2022

Hi there, adding the below JavaScript to the Onload portion of the question should do what you're looking for:
jQuery("#"+this.questionId+" .ReadableAlt").css("background","#F8F8F8");


Forum|alt.badge.img
  • Author
  • Answer
  • April 26, 2022

You're a genius Tom - thank you!


Forum|alt.badge.img

I am fairly new to this, but I would like to shade rows in a matrix table. Where is the onload portion of the question?


Tom_1842
Level 8 ●●●●●●●●
Forum|alt.badge.img+28
  • Level 8 ●●●●●●●●
  • July 14, 2022

Hi SWhitfield, with your Matrix question selected in the Survey Builder, scroll to the bottom of the Edit Question pane until you see the " JavaScript" option under Question Behavior. This page has a bit more on it.
For Matrix question types, try adding the below to the Onload section:
jQuery("#"+this.questionId+" .ChoiceRow:odd").css("background","#F8F8F8");


Forum|alt.badge.img

I ditto the genius comment! Thank you so much.