How can I add text above the statements in a matrix table? | XM Community
Solved

How can I add text above the statements in a matrix table?


Badge +1
I'm trying to replicate a survey that was originally on paper, so I've been asked to keep the formatting of all the questions the same in the web version. The original document has a matrix type question with a label for the column of statement items (to the left of the scale labels, in the area that is generally blank in the upper left corner of the table.) Does anyone know how to add text in that area using some Javascript?
icon

Best answer by TomG 13 April 2018, 23:31

View original

11 replies

Userlevel 7
Badge +27
Try this:
```
jQuery("#"+this.questionId+" td.c1:first").html("Label Text");
```
Badge +1
Thanks Tom! This is exactly what I was trying to do. Just to be super picky though, is there a way to left justify the label??
Userlevel 7
Badge +27
> @marean said:
> Thanks Tom! This is exactly what I was trying to do. Just to be super picky though, is there a way to left justify the label??
```
var cell=jQuery("#"+this.questionId+" td.c1:first");
cell.css("text-align","left");
cell.html("Label Text");
```
Badge +1
Perfect! Thank you so much, Tom!!
Userlevel 3
Badge +6
@TomG : Can you help me modify this code to get the Label to align with the second row of the matrix (answer description) instead of the top row? Thank you!!
Badge

Hi TomG - Is there a way to make this label available for translation as well, while using the Translate survey option in qualtrics. I need to translate it in Japanese, Chinese simplified and Chinese Traditional.
Thanks in advance.

Userlevel 7
Badge +27

Hi TomG - Is there a way to make this label available for translation as well, while using the Translate survey option in qualtrics. I need to translate it in Japanese, Chinese simplified and Chinese Traditional.

sombwit - You can use the trick described in this post: https://www.qualtrics.com/community/discussion/comment/15542#Comment_15542

Badge

Hi everyone. Following TomG's tip, can you suggest me a way to implement exactly this text as label of the matrix? I am trying to replicate Murphy's SVO but the instruction here does not correspond with the correct layout. Thanks!
 You Receive
|
|
Other Receives



Userlevel 7
Badge +27

https://www.qualtrics.com/community/discussion/comment/36660#Comment_36660jQuery("#"+this.questionId+" td.c1:first").css("text-align","center").html("You Receive
|
|
Other Receives");

Badge +4

@TomG 

Is there a way to increase the font on: 

var cell=jQuery("#"+this.questionId+" td.c1:first");
cell.css("text-align","left");
cell.html("Label Text");

 

I’ve tried adding the items below it the script above without success.

var fontSize = 200;

and

var span = document.getElementByID("Activity");
    span.style.fontSize = "25px";

 

Thanks!

Userlevel 7
Badge +27

@TomG

Is there a way to increase the font on: 

var cell=jQuery("#"+this.questionId+" td.c1:first");
cell.css("text-align","left");
cell.html("Label Text");

 

I’ve tried adding the items below it the script above without success.

var fontSize = 200;

and

var span = document.getElementByID("Activity");
    span.style.fontSize = "25px";

 

Thanks!

It should be:

jQuery("#"+this.questionId+" td.c1:first").css({"text-align":"left","font-size":"25px"}).html("Label Text");

 

Leave a Reply