Welcome to the LimeSurvey Community Forum

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

Additional Array Header

  • tixeon
  • tixeon's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 6 months ago - 9 years 6 months ago #112265 by tixeon
Additional Array Header was created by tixeon
I have a 0-10 rating in an array and would like to add a header row for the 0-10 columns (not the Don't know column).
The left most label (Not at all) needs to be left aligned and the right most (extremely) needs to be right aligned.


(don't need the underline)

I tried adjusting the script posted here with no success: www.limesurvey.org/en/forum/can-i-do-thi...rray-question#101280
Last edit: 9 years 6 months ago by tixeon. Reason: Inserted image example
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 6 months ago - 9 years 6 months ago #112282 by tpartner
Replied by tpartner on topic Additional Array Header
You could add something like this to the source of the array. This will insert a new row in the <thead> of the array table.

Code:
<script type="text/javascript" charset="utf-8">  
    $(document).ready(function(){
 
    // Identify this question
    var thisQuestion = $('#question{QID}');
 
    // Insert the new header row
    $('table.subquestions-list thead', thisQuestion).prepend('<tr class="new-header">\
      <td>&amp;nbsp;</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>');
  });
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 9 years 6 months ago by tpartner.
The following user(s) said Thank You: tixeon
The topic has been locked.
  • tixeon
  • tixeon's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 6 months ago #112312 by tixeon
Replied by tixeon on topic Additional Array Header
Perfect, thank you!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose