How to add headers to bipolar matrix question | XM Community
Question

How to add headers to bipolar matrix question

  • 13 May 2021
  • 2 replies
  • 108 views

Screen Shot 2021-05-13 at 3.03.23 PM.pngI want to add headers to the matrix table(bipolar); I checked the 'position text above' option since participants need to slide on their mobile version otherwise. I'm trying to create 7-point semantic differentials with headers/labels on top of the statements(from 1 to 7). I googled jQuery code and tried several times, but it did not work out for me. I've attached an example picture to explain what I would like to make. Any suggestions would be a great help - Thank you in advance!



2 replies

Userlevel 7
Badge +27

Hi there, while I am not sure how to add a header row that contains Numbers to a Matrix Bipolar question with Position Text Above, a similar effect might be achieved by making the radio buttons a bit larger and then placing the Number labels within them.
MatrixBipolarNumbers.pngTo try this, add the below to the Matrix question's JavaScript in the OnReady section:
jQuery("#"+this.questionId+" label.q-radio").css({
"width":"1.6em",
"height":"1.6em",
"line-height":"1.6em"
});

jQuery("#"+this.questionId+" td:nth-child(1) > label").html("1");
jQuery("#"+this.questionId+" td:nth-child(2) > label").html("2");
jQuery("#"+this.questionId+" td:nth-child(3) > label").html("3");
jQuery("#"+this.questionId+" td:nth-child(4) > label").html("4");
jQuery("#"+this.questionId+" td:nth-child(5) > label").html("5");
jQuery("#"+this.questionId+" td:nth-child(6) > label").html("6");
jQuery("#"+this.questionId+" td:nth-child(7) > label").html("7");

Userlevel 7
Badge +27

Modifying the method used in this thread would be a good starting point if anyone needs to create a header row that contains Numbers, but I think I still lean towards putting the numbers in the radio buttons.

Leave a Reply