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

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

  • November 3, 2018
  • 7 replies
  • 1802 views

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

Best answer by TomG

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.

7 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • November 3, 2018
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.

Forum|alt.badge.img+2
  • Author
  • November 3, 2018
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

  • September 24, 2019
@TomG or @Jed, I am having the same issue. Can you share the javascript you use to change the column widths?

Forum|alt.badge.img+7
  • Level 2 ●●
  • September 25, 2019
@TomG I'm also wondering how to read out those divs/WithStruts... how do I gain access to them?

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • September 25, 2019
> @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.

Forum|alt.badge.img+7
  • Level 2 ●●
  • September 25, 2019
> @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! 😀