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

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

  • April 13, 2018
  • 11 replies
  • 1354 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"); ```

11 replies

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

Forum|alt.badge.img+1
  • Author
  • 8 replies
  • April 13, 2018
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 ●●●●●●●●
  • 6084 replies
  • April 14, 2018
> @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
  • 8 replies
  • April 14, 2018
Perfect! Thank you so much, Tom!!

Forum|alt.badge.img+10
  • Level 2 ●●
  • 34 replies
  • March 24, 2020
@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
  • 2 replies
  • April 2, 2020

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 ●●●●●●●●
  • 6084 replies
  • April 2, 2020

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
  • 3 replies
  • April 19, 2021

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 ●●●●●●●●
  • 6084 replies
  • April 19, 2021

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
  • 1 reply
  • November 20, 2023

@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 ●●●●●●●●
  • 6084 replies
  • November 21, 2023

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