- Posts: 3
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // Identify this question var qID = {QID}; var thisQuestion = $('#question'+qID); // Remove LS imposed column widths $('colgroup', thisQuestion).remove(); // Move the table cells $('table.subquestion-list thead tr', thisQuestion).each(function(i, thisRow) { $('td.header_separator', thisRow).after($('th.header_answer_text', thisRow)).remove(); }); $('tr.answers-list', thisQuestion).each(function(i, thisRow) { $('td.dual_scale_separator', thisRow).after($('th.answertext', thisRow)).remove(); }); // Insert the center header label var centerHeader = 'Learning Methods'; $('table.subquestion-list thead tr:eq(0) th.header_answer_text', thisQuestion).text(centerHeader); // Insert some clean-up styles (could be placed in template.css) $('<style type="text/css">\ #question'+qID+' th.header_answer_text, #question'+qID+' th.answertext {\ width:50%;\ text-align:center;\ hyphens: none;\ overflow-wrap: normal;\ }\ #question'+qID+' td.radio-item {\ padding: 10px;\ }\ #question'+qID+' .radio label::before, #question'+qID+' .radio label::after {\ margin-left: 0;\ }\ @media only screen and (max-width: 801px) {\ #question'+qID+' th.answertext {\ clear: both;\ text-align: left;\ }\ #question'+qID+' td.radio-item {\ float: left;\ width: auto !important;\ }\ }\ </style>').appendTo( "head" ) }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // Identify this question var qID = {QID}; var thisQuestion = $('#question'+qID); // Remove LS imposed column widths $('colgroup', thisQuestion).remove(); // Move the table cells $('table.subquestion-list thead tr', thisQuestion).each(function(i, thisRow) { $('td.header_separator', thisRow).after($('th.header_answer_text', thisRow)).remove(); }); $('tr.answers-list', thisQuestion).each(function(i, thisRow) { $('td.dual_scale_separator', thisRow).after($('th.answertext', thisRow)).remove(); }); // Insert some clean-up styles (could be placed in template.css) var newStyles = '<style type="text/css">\n'+ '#question'+qID+' th.header_answer_text, #question'+qID+' th.answertext {\n'+ 'width:50%;\n'+ 'text-align:center;\n'+ 'hyphens: none;\n'+ 'overflow-wrap: normal;\n'+ '}\n'+ '#question'+qID+' td.radio-item {\n'+ 'padding: 10px;\n'+ '}\n'+ '#question'+qID+' .radio label::before, #question'+qID+' .radio label::after {\n'+ 'margin-left: 0;\n'+ '}\n'+ '@media only screen and (max-width: 801px) {\n'+ '#question'+qID+' th.answertext {\n'+ 'clear: both;\n'+ 'text-align: left;\n'+ '}\n'+ '#question'+qID+' td.radio-item {\n'+ 'float: left;\n'+ 'width: auto !important;\n'+ '}\n'+ '}\n'+ '</style>' $('head').append(newStyles); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // Identify this question var qID = {QID}; var thisQuestion = $('#question'+qID); // Remove LS imposed column widths $('colgroup', thisQuestion).remove(); // Move the table cells $('table.subquestion-list thead tr', thisQuestion).each(function(i, thisRow) { $('td.header_separator', thisRow).after($('th.header_answer_text', thisRow)).remove(); }); $('tr.answers-list', thisQuestion).each(function(i, thisRow) { $('td.dual_scale_separator', thisRow).after($('th.answertext', thisRow)).remove(); }); // Insert the center header label var centerHeader = ' '; $('table.subquestion-list thead tr:eq(0) th.header_answer_text', thisQuestion).text(centerHeader); // Insert some clean-up styles (could be placed in template.css) var newStyles = '<style type="text/css">\n'+ '#question'+qID+' th.header_answer_text, #question'+qID+' th.answertext { \n'+ 'width:50%;\n'+ 'text-align:center;\n'+ 'hyphens: none;\n'+ 'overflow-wrap: normal;\n'+ '}\n'+ '#question'+qID+' td.radio-item { \n'+ 'padding: 10px;\n'+ '}\n'+ '#question'+qID+' .radio label::before, #question'+qID+' .radio label::after { \n'+ 'margin-left: 0;\n'+ '}\n'+ '@media only screen and (max-width: 801px) { \n'+ '#question'+qID+' th.answertext { \n'+ 'clear: both;\n'+ 'text-align: left;\n'+ '}\n'+ '#question'+qID+' td.radio-item { \n'+ 'float: left;\n'+ 'width: auto !important;\n'+ '}\n'+ '}\n'+ '</style>' $('head').append(newStyles); }); </script>