Alternate row shading | XM Community
Skip to main content

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

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");


You're a genius Tom - thank you!


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?


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");


I ditto the genius comment! Thank you so much.


Leave a Reply