Add color background behind just one column on a matrix table question? | XM Community
Skip to main content
First time in the community and was searching for this, but didn't see this questions asked / answered. Sorry if I'm in the wrong category.



I'd like to add a background color (e.g., light gray) to just one column on a matrix table question (e.g., "Not sure / unable to judge" option). Thanks in advance!
Hello @ballred ,



Paste the below code in the matrix question js(OnReady) and update the column position in code:



var c= 1 //Enter the column position

var n=3+c;

jQuery("#"+this.questionId+" td.c"+n+" , th.c"+n+"").css("background","lightgrey");
You're an absolute legend, Shashi! Wizard indeed. Thanks so much 🙂
@Shashi: If you wanted to get crazy with the colors and pick a RGB code instead, how would you go about that? Sorry, so new to this stuff. Thanks!
> @ballred said:

> @Shashi: If you wanted to get crazy with the colors and pick a RGB code instead, how would you go about that? Sorry, so new to this stuff. Thanks!



Check this

Hi,
Also a first timer in the community. And definitely not a programmer. I am also trying to change one column in a question. It is a bipolar matrix question and I would like to change the colour of the middle column to light grey. It works when I paste the abovementioned code, but then it changes all the columns to grey. I am not sure where to enter the column number in the code to only change the middle column (Column number 4)?


Leave a Reply