Welcome to the LimeSurvey Community Forum

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

repeat two headers in array table

  • mt9999
  • mt9999's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 3 months ago #226267 by mt9999
repeat two headers in array table was created by mt9999
Please help us help you and fill where relevant:Your LimeSurvey version: 5.2.13Own server or LimeSurvey hosting: LimeSurveySurvey theme/template: Fruity==================Hi everyone, I created an additional row on top of my array table based on this locked thread ( forums.limesurvey.org/forum/design-issue...-adding-array-header ) but wondering how to make it so that it appears after X amount of subquestions now. If I use the option "Repeat Headers" under Display options, it'll only repeat my second header but I'd like both headers to appear. Thank you all!  

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 months ago #226271 by Joffm
Replied by Joffm on topic repeat two headers in array table
Hi, my idea.
Add the subheader solution to it.
 

Adapt to your needs.

 

File Attachment:

File Name: limesurvey...5846.lss
File Size:32 KB


Joffm


 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: LISHANGQI

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 months ago #226274 by tpartner
Replied by tpartner on topic repeat two headers in array table
And, my two cents:
 
 
Code:
<script type="text/javascript" data-author="Tony Partner">  
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // Identify this question
    var thisQuestion = $('#question{QID}');
 
    // Define the new row
    var insertedRow = '<tr>\
      <td></td>\
      <th colspan="1" class="text-center"><span style="font-size:20px;"><strong>No</th>\
      <th colspan="1" class="text-center"><span style="font-size:20px;"><strong>Yes</th>\
      <th colspan="2" class="text-center"><span style="font-size:20px;"><strong>Yes etc</th>\
            <th colspan="2" class="text-center"><span style="font-size:20px;"><strong>Yes etc</th>\
            <th colspan="2" class="text-center"><span style="font-size:20px;"><strong>Yes etc</th>\
            <th colspan="2" class="text-center"><span style="font-size:20px;"><strong>Yes etc</th>\
    </tr>';
 
    // Insert the new row before all header rows
    $('table.subquestion-list tr.ls-heading', thisQuestion).before(insertedRow);
 
    });
</script>

Sample survey attached: 

File Attachment:

File Name: limesurvey...6(1).lss
File Size:36 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: LISHANGQI, mt9999

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 months ago #226277 by Joffm
Replied by Joffm on topic repeat two headers in array table
Hi, Tony,
as usual the better one.
I missed the class .ls-heading.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: mt9999

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose