How to add a vertical line before last column in a multiple choice question with horizontal layout? | XM Community
Solved

How to add a vertical line before last column in a multiple choice question with horizontal layout?

  • 9 September 2019
  • 16 replies
  • 346 views

Userlevel 2
Badge +5
  • Level 1 ●
  • 22 replies
Hello Community,

I have a multiple choice question with horizontal layout of the options. The last option is "Don't know". I want to add a vertical line before this option on the left side. I searched the internet and tried couple of options, but no success so far. Can anybody please help.

Thanks,
Ank
icon

Best answer by TomG 10 September 2019, 14:58

View original

16 replies

Userlevel 7
Badge +27
Add this CSS to the question text:
```
<style>
@media only screen and (min-width:481px) {
td:last-of-type { border-left: 1px solid grey; }
td:last-of-type label { margin-left:10px; }
}
</style>
```
Adjust border-left and margin-left properties as needed.
Userlevel 2
Badge +5
Thank you @TomG , it worked perfectly.
Thanks,
Ank
Badge
Thank you.
Is there an option to do this vertical line, but just on one of my matrix questions in the survey?
I don't want it to affect the other matrix questions.
Userlevel 7
Badge +27
> @MAYA3 said:
> Thank you.
> Is there an option to do this vertical line, but just on one of my matrix questions in the survey?
> I don't want it to affect the other matrix questions.

Use this JS:
https://gist.github.com/marketinview/cd5d385d8803124078a0
Badge
Thanks.
When I'm trying to paste this JS on the question script, it writes the message attached below. What should I do?
Badge
Thanks!> @TomG said:
> > @MAYA3 said:
> > Thank you.
> > Is there an option to do this vertical line, but just on one of my matrix questions in the survey?
> > I don't want it to affect the other matrix questions.
>
> Use this JS:
> https://gist.github.com/marketinview/cd5d385d8803124078a0


Hi,
I will highly appreciate your help in solving it.
Userlevel 7
Badge +27
> @MAYA3 said:
> Thanks.
> When I'm trying to paste this JS on the question script, it writes the message attached below. What should I do?
That error is unrelated to the script. It appears you have an Internet connectivity issue.

Hi TomG, I am currently trying to add the line you provided:

it works perfectly! However, is there a way to modify, 1) the transparency of the line (I would like the line more faded out) and 2) a way to add the line before the last 3 response option of the question (instead of adding the line before the last response)? If you have any information, I would greatly appreciate it!

Ana

I'm sorry, in addition, is there a way to only add this to a singular multiple choice question?

Userlevel 7
Badge +27

However, is there a way to modify, 1) the transparency of the line (I would like the line more faded out)

change the border style
and 2) a way to add the line before the last 3 response option of the question (instead of adding the line before the last response)?

use nth-child
in addition, is there a way to only add this to a singular multiple choice question?

make the selector specific to the question
https://www.w3schools.com/Css/

TomG Thank you so much!

Screen Shot 2020-06-09 at 10.58.00 AM.pngTomG Do you know how to fix this issue? The code worked and added the line for my I don't know column but it also added a line in the very front of my matrix. Thanks!

Userlevel 2
Badge +6

https://www.qualtrics.com/community/discussion/comment/26446#Comment_26446same thing happens for me. bumping this again in case anyone know how to fix!

Userlevel 7
Badge +27

https://www.qualtrics.com/community/discussion/comment/28816#Comment_28816You've combined the two different solutions on this thread: one for horizontal multiple choice and one for matrix. Remove the CSS that only applies to horizontal multiple choice from your matrix question.

Badge

Screen Shot 2020-06-09 at 10.58.00 AM.pngTomG Do you know how to fix this issue? The code worked and added the line for my I don't know column but it also added a line in the very front of my matrix. Thanks!

Screen Shot 2020-06-09 at 10.58.00 AM.pngTomG Do you know how to fix this issue? The code worked and added the line for my I don't know column but it also added a line in the very front of my matrix. Thanks!

Hi, did you fix this? I have the same issue, but I did not figure out. 

Badge

Hi, I have the same issue. I added in the html under the question text.

<style>
@media only screen and (min-width:481px) {
td:last-of-type { border-left: 1px solid grey; }
td:last-of-type label { margin-left:10px; }
}
</style>

I see the line to the very left of my matrix, which is unwanted. What language should I add in html to remove? Thanks!  

Leave a Reply