- Posts: 5
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Table with header on top and bottom
- Fabian44
- Topic Author
- Offline
- New Member
Less
More
3 years 11 months ago #198244
by Fabian44
Table with header on top and bottom was created by Fabian44
Hey, guys one questions. I would like to repeat the header of a matrix table on the bottom as well. So that the same header is on top and bottom. Is that possible in an easy way?
thanks
thanks
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
3 years 11 months ago #198249
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Table with header on top and bottom
Add this script to the question text:
Sample survey attached:
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ $('#question{QID} table.subquestion-list').append($('#question{QID} table.subquestion-list thead').clone()); }); </script>
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Fabian44
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
3 years 11 months ago #198650
by Fabian44
Replied by Fabian44 on topic Table with header on top and bottom
Thank you very much! Your solution works as described!
Unfortunately I recognised another problem, as it can be seen in the attachment. In the header in the bottom, I would like to have the number first (for example: 1) and below the number the text (for example: Disagree completely). Is it possible to do so? For example by adding specific text for every column in the bottom.
Thanks for you help!
Unfortunately I recognised another problem, as it can be seen in the attachment. In the header in the bottom, I would like to have the number first (for example: 1) and below the number the text (for example: Disagree completely). Is it possible to do so? For example by adding specific text for every column in the bottom.
Thanks for you help!
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
3 years 11 months ago #198698
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Table with header on top and bottom
Can you attach an export of a sample survey (.lss file) containing only that question?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Fabian44
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
3 years 11 months ago #198724
by Fabian44
Replied by Fabian44 on topic Table with header on top and bottom
Yeah, of yourse.
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
3 years 11 months ago #198737
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Table with header on top and bottom
1) Remove the <p> elements from your answers and use <br> tags for line breaks.
2) Insert this script in the question source:
Sample survey attached:
2) Insert this script in the question source:
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ $('#question{QID} table.subquestion-list').append($('#question{QID} table.subquestion-list thead').clone()); $('#question{QID} table.subquestion-list thead:last th').each(function(i) { var thisHTML = $(this).html(); if(thisHTML.indexOf('<br>') >= 0) { var aThisHTML = $(this).html().split('<br>'); $(this).html(aThisHTML[1]+'<br>'+aThisHTML[0]); } }); $('#question{QID} table.subquestion-list thead:last th').css('vertical-align', 'top'); }); </script>
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
3 years 11 months ago #198749
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Table with header on top and bottom
Can't we use some css class ?
For example
HTML
and css :
thead .notinhead{display:none]
If i don't make error , the seond header lien was in tbody ?
For example
HTML
Code:
1 <span class="notinhead">disagree</span>
and css :
thead .notinhead{display:none]
If i don't make error , the seond header lien was in tbody ?
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
3 years 11 months ago #198758
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Table with header on top and bottom
Sure, but my thinking is that since we're already using JS to insert the bottom row, there is no need to bother with extra HTML and CSS.
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: DenisChenu
The topic has been locked.