Welcome to the LimeSurvey Community Forum

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

Double Array question: Sub-questions column width won't change

  • RTOPS
  • RTOPS's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 1 month ago #148338 by RTOPS
Hello everyone!

I am new to LM and learning :) Thank you for your time.

I am trying to design a double array table, but the sub-questions column is so narrow that each questions can take up to 7-8 lines, which makes the reading very difficult. I have tried different numbers in the "(Sub-) question width:" option, but at the end it doesn’t change the sub-questions column width. I guess I will have to modify the template? I would like to extend the sub-questions columns (2-3 times wider than it is right now) and, if possible, reduce the width of the 14 answers columns.

Survey’s template: Ubuntu_orange
LM: Version 2.51.4+160908

Here is an example of the question:

The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 1 month ago #148346 by holch
I see your problem here and yes, this is very little space for the subquestions. But to be honest, I don't see how to make the other columns smaller, they are already quite tight together and if they get any closer, it will start to get difficult to answer.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • RTOPS
  • RTOPS's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 1 month ago - 7 years 1 month ago #148347 by RTOPS
Problem solved! I had to add this code to template.css :


.table{
table-layout: fixed;
}
Last edit: 7 years 1 month ago by RTOPS.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 1 month ago #148348 by holch
Great. Have a screen shot how it looks now?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • RTOPS
  • RTOPS's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 1 month ago - 7 years 1 month ago #148349 by RTOPS
Sure! I've added some color:

Last edit: 7 years 1 month ago by RTOPS.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 1 month ago #148350 by holch
It's quite tight, but should be still doable to respond. Looks a lot better, but will probably not work on mobile devices anymore.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • RTOPS
  • RTOPS's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 1 month ago #148351 by RTOPS
Thanks for the input holch!

I've used a solution from this forum. I would like to reduce the space between the 2 arrays, but I don't know what part of the code I have to modify. Here is the code I added in template.js:

$(document).ready(function(){

// Array dual-scale - assign column and scale specific classes
if($('.table-dual-scale').length > 0) {

$('.table-dual-scale thead tr:nth-child(1)').each(function(i){
var scale = 0;
$('> *', this).not('.header_answer_text').each(function(i){
if(!$(this).hasClass('header_separator')) {
$(this).addClass('scale-'+scale+'');
}
else {
scale++;
}
});
});

$('.table-dual-scale thead tr:nth-child(2)').each(function(i){
var column = 1;
var scale = 1;
$('> *', this).not('.header_answer_text').each(function(i){
if(!$(this).hasClass('header_separator')) {
$(this).addClass('scale-'+scale+' column-'+column+'');
column++;
}
else {
column = 1;
scale++;
}
});
});

$('.table-dual-scale tr.answers-list').each(function(i){
var column = 1;
var scale = 1;
$('td', this).each(function(i){
if($(this).hasClass('radio-item')) {
$(this).addClass('scale-'+scale+' column-'+column+'');
column++;
}
else if($(this).hasClass('dual_scale_separator')) {
column = 1;
scale++;
}
});
});
}
});
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 1 month ago #148363 by tpartner
Can you activate a live example so we can see the source?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • RTOPS
  • RTOPS's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 1 month ago #148370 by RTOPS
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 1 month ago #148387 by DenisChenu
With already existing css ....
www.limesurvey.org/community-services/fo...-r%C3%A9ponse#148382

Add this col.separator{width:0}

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • RTOPS
  • RTOPS's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 1 month ago - 7 years 1 month ago #148413 by RTOPS
Hi Denis,

I've added your code to template.css, but the space between the 2 arrays is still the same. I might be doing something wrong here:

.table > thead > tr > th.header_separator, .table > tbody > tr > th.header_separator,
.table > thead > tr > td.header_separator, .table > tbody > tr > td.header_separator{
padding:0;
}
col.separator{width:0}
Last edit: 7 years 1 month ago by RTOPS.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 1 month ago #148431 by tpartner
Your CSS selector isn't specific enough.

Code:
.table-dual-scale col.separator {
    width: 0;
}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose