How can I add text above the statements in a matrix table? | Experience Community
Skip to main content
Solved

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

  • Apr 13, 2018 6:40 PM UTC
  • 11 replies
  • 1580 views

Forum|alt.badge.img+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?

Best answer by TomG

Try this: ``` jQuery("#"+this.questionId+" td.c1:first").html("Label Text"); ```
View original

11 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • Apr 13, 2018 9:31 PM UTC
Try this: ``` jQuery("#"+this.questionId+" td.c1:first").html("Label Text"); ```

Forum|alt.badge.img+1
  • Author
  • Apr 13, 2018 11:26 PM UTC
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??

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Apr 14, 2018 12:59 PM UTC
> @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"); ```

Forum|alt.badge.img+1
  • Author
  • Apr 14, 2018 9:11 PM UTC
Perfect! Thank you so much, Tom!!

Forum|alt.badge.img+10
  • Level 2 ●●
  • Mar 24, 2020 10:27 PM UTC
@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!!

Forum|alt.badge.img
  • Apr 2, 2020 4:13 AM UTC

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.


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Apr 2, 2020 11:48 AM UTC

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


Forum|alt.badge.img
  • Apr 19, 2021 11:38 AM UTC

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




TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Apr 19, 2021 12:12 PM UTC

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


_mj
Forum|alt.badge.img+4
  • Nov 20, 2023 5:13 PM UTC

@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!


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Nov 21, 2023 1:27 PM UTC

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