- Posts: 55
- Thank you received: 3
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ $('#question{QID} tr.ls-heading th:nth-child(5)').text(''); $('#question{QID} tr[id^="javatbd"] .answer-item:nth-child(5) *').remove(); }); </script> <style type="text/css">#question{QID} col:nth-child(5) { width: 4% !important [color=#e74c3c] height: 4% !important;[/color] } #question{QID} tr.ls-heading th:nth-child(5), #question{QID} tr[id^="javatbd"] .answer-item:nth-child(5) { padding: 0 !important; } td.answer_cell_99 { background-color: !important; border-left: 2px solid #B8B8B8 !important; } </style> </p>
Please Log in to join the conversation.
The problem with inserting a new column is that it will mess with the widths of the existing columns.Furthermore I would be thankful if I did not need to manually add an empty column to each matrix, but just insert an empty column/row in front of answer_cell_99. Is this possible?
Please Log in to join the conversation.
Please Log in to join the conversation.
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify some elements var thisQuestion = $('#question{QID}'); var thisTable = $('table.subquestion-list', thisQuestion); // Adjust column widths var spacerWidthPercent = 2; var labelWidth = ($('col:first', thisTable).width()/$('colgroup:first', thisTable).width())*100; var answerWidth = (100-labelWidth-spacerWidthPercent)/$('col:gt(0)', thisTable).length; $('col:gt(0)', thisTable).width(answerWidth+'%'); // Insert some elements $('col:last', thisTable).before('<col class="inserted-spacer">'); $('thead th:last-child, tr.ls-heading-repeat th:last-child', thisTable).before('<th class="inserted-spacer" />'); $('tbody td.answer-item:last-child', thisTable).before('<td class="inserted-spacer" />'); }); </script>
<style type="text/css" data-author="Tony Partner"> @media only screen and (max-width: 768px) { #question{QID} table.ls-answers tbody td.inserted-spacer { height: 20px; min-height: 0; padding: 0; } } </style>
Please Log in to join the conversation.
$(document).on('ready pjax:scriptcomplete',function(){ $('.array-flexible-row.inserted-spacer-question').each(function(e) { // Identify some elements var thisQuestion = $(this); var thisTable = $('table.subquestion-list', thisQuestion); // Adjust column widths var spacerWidthPercent = 2; var labelWidth = ($('col:first', thisTable).width()/$('colgroup:first', thisTable).width())*100; var answerWidth = (100-labelWidth-spacerWidthPercent)/$('col:gt(0)', thisTable).length; $('col:gt(0)', thisTable).width(answerWidth+'%'); // Insert some elements $('col:last', thisTable).before('<col class="inserted-spacer">'); $('thead th:last-child', thisTable).before('<th class="inserted-spacer" />'); $('tbody td.answer-item:last-child', thisTable).before('<td class="inserted-spacer" />'); }); });
@media only screen and (max-width: 768px) { .inserted-spacer-question tbody td.inserted-spacer { height: 20px; min-height: 0; padding: 0; } }
Please Log in to join the conversation.
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $('#question{QID}').addClass('inserted-spacer-question'); }); </script>
@media only screen and (max-width: 768px) { .inserted-spacer-question tbody td.inserted-spacer { height: 20px; min-height: 0; padding: 0; } }
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
@media only screen and (max-width: 760px) { table.ls-answers .ls-label-xs-visibility > em, table.ls-answers .ls-label-xs-visibility > i { position: relative; } }
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.