Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Change width of Column in Array-Test question

  • waza-ari
  • waza-ari's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #226574 by waza-ari
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.3.6
Own server or LimeSurvey hosting: Self Hosted
Survey theme/template: default
==================

Hi there,

I would like to change the width of the columns in a array text survey. I have seen countless threads (many of them more than 9 years old) and was unable to make them work. What I want to achieve:



The left hand side contains the description and should be much wider, while the right column simply contains a text field and should be much, much smaller.

Attempt 1

My first maybe somewhat naive attempt following some forum advice was to set Display > (Sub-)question width to a certain value. I though setting this to - say 25% - would force the first column to become bigger. This didn't work.

Attempt 2

I embedded the following code in the question HTML code (shamelessly stolen from another post here):
Code:
<script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
        var qID = {QID};
 
        $('#question'+qID+' .subquestions-list col').css({
            'width':'auto'
        });
        $('#question'+qID+' .subquestions-list thead td').css({
            'width':'75%'
        });
        $('#question'+qID+' .subquestions-list thead th:eq(0)').css({
            'width':'25%'
        });
        $('#question'+qID+' .subquestions-list input[type="text"]').css({
            'width':'90%'
        });
    });
</script>

This changed nothing. I did set Filter HTML for XSS to Off in Settings > Global > Security, with no obvious result.

How do I change the width of these column? Many thanks in advance!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #226577 by Joffm
Hi,
your first approach is correct.
Here you see a setting of 75(%)
 

I have seen countless threads (many of them more than 9 years old) and was unable to make them work.

No, there are many threads about column width that are newer.
E.g.
[url] forums.limesurvey.org/forum/design-issue...urvey-preview#216162 [/url]
Point 2. below the array image.

But this is more related to different column widths and not just the setting of the subquestion column width.

And - as you seem to be German - have a look at my tutorial "Tutorial 1: Matrizen" in the German part. (Chapter 2)
Seems to be on page 3 at the moment.

Joffm




 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • waza-ari
  • waza-ari's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #226596 by waza-ari
Replied by waza-ari on topic Change width of Column in Array-Test question
Hi Joffm,

first of all, thank you for your answer!

your first approach is correct.
Here you see a setting of 75(%)

Tried this right now, but it doesn't seem to have the desired effect, The width of the two columns does not change at all. I made sure to remove the custom JavaScript from the question, so that only this setting is in effect, but the layout is unchanged (at least in the Survey preview).

Scratch that. I actually entered "75%" in the settings field, not just 75. I thought it would allow me to enter the unit (em, px, ...) as well, but it accepts a number and treats this as percent value.

It works now, I will have a look at your tutorial as I'm still fairly new to Limesurvey.

Thanks for your help again!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #226597 by Joffm

I'm still fairly new to Limesurvey.

Therefore:
Read the manual - at least about question types and ExpressionManager/Script.
You see:
[url] www.limesurvey.org/manual/Question_type_...subquestion_width.29 [/url]

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose