- Posts: 74
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Array Table too Small
- Winocll_48635
- Topic Author
- Offline
- Banned
- The array table comes out way too small
- I need to get rid of the middle white line between the two headers in the array
Here's a pic of the problematic question:
Here's how the question code looks:
5. Overall, how would you rate your customer service experience? <script type="text/javascript" charset="utf-8">
$(document).ready(function(){
// ADD HEADER ROW
var thisQuestion = $('#question{QID}');
// Insert the new header row
$('table.subquestions-list thead', thisQuestion).prepend('<tr class="new-header">\
<td> </td>\
<th colspan="6" style="text-align:left;">Not at all important</th>\
<th colspan="5" style="text-align:right;">Extremely important</th>\
<th></th>\
</tr>');
// HIDE SUB-QUESTION
var thisQuestion = $('#question{QID}');
// Hide the sub-question column
$('.subquestions-list .col-responses .col-answers', thisQuestion).hide();
$('.subquestions-list thead td', thisQuestion).hide();
$('.subquestions-list .answertext', thisQuestion).hide();
});
</script>
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10611
- Thank you received: 3690
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // IDENTIFY THIS QUESTION var thisQuestion = $('#question{QID}'); // HIDE SUB-QUESTION $('.subquestions-list .col-answers', thisQuestion).remove(); $('.subquestions-list thead td', thisQuestion).remove(); $('.subquestions-list .answertext', thisQuestion).remove(); $('.subquestions-list col', thisQuestion).attr('width', (100/$('.subquestions-list col', thisQuestion).length)+'%'); // ADD HEADER ROW $('table.subquestions-list thead', thisQuestion).prepend('<tr class="new-header">\ <th colspan="11" style="text-align:left;">Not at all important<span style="float:right">Extremely important</span></th>\ <th></th>\ </tr>'); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- Winocll_48635
- Topic Author
- Offline
- Banned
- Posts: 74
- Thank you received: 1
Thank you sooo much.
Is there a way to get the table bigger? When i do an array that has subquestions it is larger, but when i add the script it gets smaller.
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10611
- Thank you received: 3690
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- Winocll_48635
- Topic Author
- Offline
- Banned
- Posts: 74
- Thank you received: 1
somptech.com/rks/lime/index.php/567743?lang=en
In measuring the width of the scales it looks like the array question that has subquestions is 471 pixels wide while the array question that hides subquestions is 448 pixels wide.
But i would like to know how to enlarge (widen and heighten if necessary) the tables even if they were the same size in case that is needed on a particular survey.
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10611
- Thank you received: 3690
table.subquestions-list { width: 100%; }
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- Winocll_48635
- Topic Author
- Offline
- Banned
- Posts: 74
- Thank you received: 1
I imagine since the problem is with array questions that hide the subquestions that changing the subquestion list width doesn't apply to this issue.
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10611
- Thank you received: 3690
div.answers table { width: 100%; }
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- Winocll_48635
- Topic Author
- Offline
- Banned
- Posts: 74
- Thank you received: 1