Welcome to the LimeSurvey Community Forum

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

Adding text to table cells in arrays

More
6 years 4 months ago #183907 by krosser
Hi guys!
I would like to add text to the first cell in the heading of an array. Any help would be much appreciated.



Sample survey attached:

File Attachment:

File Name: limesurvey...5628.lss
File Size:25.75 KB

I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
The topic has been locked.
More
6 years 4 months ago #183946 by tpartner
Place something like this in the question source:

Code:
<script type="text/javascript" charset="utf-8">  
    $(document).on('ready pjax:scriptcomplete',function(){
 
    // Identify this question
    var thisQuestion = $('#question{QID}');
 
    // Insert header text
    var insertedText = "Inserted text";
    $('table.subquestion-list thead tr:last td:first', thisQuestion).addClass('inserted-header').append(insertedText);
  });
</script>

And maybe something like this in custom.css:

Code:
td.inserted-header {
  font-weight: bold;
  text-align: center;
  vertical-align: middle !important;
}

Sample survey attached:

File Attachment:

File Name: limesurvey...6281.lss
File Size:26.14 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: krosser
The topic has been locked.
More
6 years 4 months ago #183952 by krosser
Awesome! Many thanks, Tony.

I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose