Welcome to the LimeSurvey Community Forum

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

Defining each column width in Array (Text) questions

More
4 years 1 week ago #197138 by Vinicos
I mean... it's the 3.17.7+190627 version
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 week ago #197144 by Joffm
Here you see
www.limesurvey.org/forum/can-i-do-this-w...rvey?start=15#186378

You may skip the statements that only refer to background-color.
So this is sufficient:

.custom-array table.subquestion-list thead .column-1 { width: 23%; }
.custom-array table.subquestion-list thead .column-2 { width: 15%; }
...

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 week ago #197146 by tpartner
@Vinicos, are you trying to change the column widths or the text input widths?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 week ago #197147 by Joffm
Oh, I saw that the "old", original post was about:

I am using limesurvey 2.50, I want to have different input box width for each multiple short text subquestions.

Alzheimer or the glasses get worse.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 week ago - 4 years 1 week ago #197148 by tpartner

Alzheimer or the glasses get worse.

I have both. :)

With Javascript:

Code:
<script type="text/javascript" charset="utf-8">  
  $(document).on('ready pjax:complete',function() {
 
    // Identify this question
    var thisQuestion = $('#question{QID}');
 
    // First column
    $('td.answer-item:nth-child(2) input:text', thisQuestion).attr('size', 4);
    // Second column
    $('td.answer-item:nth-child(3) input:text', thisQuestion).attr('size', 20);
  });
</script>

With CSS:

Code:
<style type="text/css">
 
  /* First column */
  #question{QID} td.answer-item:nth-child(2) input[type="text"] {
    width: 50px;
  }
 
  /* Second column */
  #question{QID} td.answer-item:nth-child(3) input[type="text"] {
    width: 150px;
  }
</style>


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 1 week ago by tpartner.
The topic has been locked.
More
4 years 1 week ago #197150 by Vinicos
The column widths!
The topic has been locked.
More
4 years 1 week ago #197159 by Vinicos
It works well now!
Thanks very much!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose