- Posts: 36
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify this question var thisQuestion = $('#question{QID}'); // Define the sub-heading text strings, cambia como quieres var subHeading1 = '<span style="color:maroon;font-size:12pt;font-weight:bold">Subquestions 1-3</span>'; var subHeading2 = '<span style="color:maroon;font-size:12pt;font-weight:bold">Subquestions 4-5</span>'; var columnsLength = $('tr.subquestion-list:eq(0) > *', thisQuestion).length; // Insert the new rows $('tr.subquestion-list:eq(0)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading1+'</th></tr>'); $('tr.subquestion-list:eq(3)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading2+'</th></tr>'); // Fix up the row classes var rowClass = 1; $('table.subquestions-list tbody tr', thisQuestion).each(function(i) { if($(this).hasClass('sub-header-row')) { rowClass = 1 } else { rowClass++; $(this).removeClass('array1 array2') if(rowClass % 2 == 0) { $(this).addClass('array2'); } else { $(this).addClass('array1'); } } }); }); </script>
Please Log in to join the conversation.