How to show matrix as accordion on desktop | XM Community
Skip to main content
Solved

How to show matrix as accordion on desktop

  • April 10, 2019
  • 5 replies
  • 297 views

Forum|alt.badge.img+2
Looking for some custom code (Java, CSS, or HTML) that would make grid questions (matrix) display in accordion style on a desktop similar to how it does on mobile -- where one attribute shows at a time and collapses once an answer is selected, causing the next attribute to open. I have scoured the board and the internet and have yet to find a solution. Anyone have any ideas?

Best answer by Shamji_Abbas

Hi @GeoffK, Simply drag the vertical line present between the statements and scale point to the right as much as you can and this will give you a matrix in accordion style.

5 replies

Shamji_Abbas
QPN Level 2 ●●
Forum|alt.badge.img+3
  • QPN Level 2 ●●
  • 10 replies
  • Answer
  • April 10, 2019
Hi @GeoffK, Simply drag the vertical line present between the statements and scale point to the right as much as you can and this will give you a matrix in accordion style.

Forum|alt.badge.img+2
  • Author
  • Level 1 ●
  • 18 replies
  • April 10, 2019
That was easy, thanks! One follow up if by any chance you know. Do you by any chance know of code I could put into this question that could change the font for all the attributes (down the side of the matrix) (color = purple and font-weight = bold)....so I don't have to change each attribute individually with the Rich Content Editor?

Shamji_Abbas
QPN Level 2 ●●
Forum|alt.badge.img+3
  • QPN Level 2 ●●
  • 10 replies
  • April 11, 2019
> @GeoffK said: > That was easy, thanks! > > One follow up if by any chance you know. Do you by any chance know of code I could put into this question that could change the font for all the attributes (down the side of the matrix) (color = purple and font-weight = bold)....so I don't have to change each attribute individually with the Rich Content Editor? @GeoffK, Add JavaScript to your question and paste the below code in the addOnReady function. This should give you the required output. jQuery("#"+this.questionId+" .table-cell").css({"color":"purple","font-weight":"bold"});

Forum|alt.badge.img+2
  • Author
  • Level 1 ●
  • 18 replies
  • April 12, 2019
Thank you! Worked like a charm.

Forum|alt.badge.img

Hi @GeoffK,

Simply drag the vertical line present between the statements and scale point to the right as much as you can and this will give you a matrix in accordion style.

Is this still working, please? It didn’t work for me