How to set/control the width of individual columns in a single side by side question | XM Community
Solved

How to set/control the width of individual columns in a single side by side question

  • 3 November 2018
  • 7 replies
  • 1066 views

Badge +2
Hello,

I have a Side-By-Side question that has 2 statements and 3 columns. I would like to control width of the 3 columns independently. The statement column should be 400px, column 1=65px, column 2=65px, and column 3=40px. Column 1 and column 2 are dropdown list and column 3 is a single choice.
I am change the with of the statement column and column 3 in the survey editor. I am not able to compress the width of column 2 or 3 column which too wide. I basically want to reduce the white space on the hours and minutes columns
Can this be accomplished with javascript at the question level?

!




Thanks in advance
Jed
icon

Best answer by TomG 3 November 2018, 21:55

View original

7 replies

Userlevel 7
Badge +27
You can adjust the size of all the columns by dragging the column divider to the right of the column. You just can't see the result until you preview the question. So, to minimize the size of the hour and minutes columns, drag the divider to the right left until you reach the divider for the previous column. For the label column drag its divider to the right to increase the size.

After you've resized them by dragging, there will be a div with a class of WidthStrut under the tr with the class Headings for each column (th.c1, th.SBS1, th.SBS2, th.SBS3). You can use JavaScript to fine tune the widths if necessary.
Badge +2
Thanks! Worked perfectly. Never knew that the middle columns didn't refresh.
Hi there!

I am working on the same problem and hoping you can share the javascript you used to change the column widths.

Thanks in advance,
Steph
@TomG or @Jed, I am having the same issue. Can you share the javascript you use to change the column widths?
Badge +7
@TomG
I'm also wondering how to read out those divs/WithStruts... how do I gain access to them?
Userlevel 7
Badge +27
> @cpschroeder said:
> @TomG
> I'm also wondering how to read out those divs/WithStruts... how do I gain access to them?

Use your browser's inspect feature.
Badge +7
> @TomG said:
> > @cpschroeder said:
> > @TomG
> > I'm also wondering how to read out those divs/WithStruts... how do I gain access to them?
>
> Use your browser's inspect feature.

Could've thought of that... thanks! 😀

Leave a Reply