Adding text to table cells in arrays

More
1 year 3 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:26 KB

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

<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:

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 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Attachments:
The following user(s) said Thank You: krosser
The topic has been locked.
More
1 year 3 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.

Start now!

Just create your account and start using Limesurvey today.

Register now