Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Changing column width of array text

Changing column width of array text 3 years 3 months ago #95326

  • Limer2001
  • Limer2001's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 18
  • Thank you received: 2
  • Karma: 0
Hi,

how can I change the column width for questions of the type: array text?

I want the question textcolumn to be 5% first column 70% second answer column 25%.

Tried different things with css and javascript but can't get it to work..

I'm on 2.00+ Build 130423
The administrator has disabled public write access.

Changing column width of array text 3 years 3 months ago #95335

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6132
  • Thank you received: 1362
  • Karma: 535
Try something like this in the source of the question:

<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		var qID = {QID};
 
		$('#question'+qID+' .subquestions-list col').css({
			'width':'auto'
		});
		$('#question'+qID+' .subquestions-list thead td').css({
			'width':'5%'
		});
		$('#question'+qID+' .subquestions-list thead th:eq(0)').css({
			'width':'70%'
		});
		$('#question'+qID+' .subquestions-list thead th:eq(2)').css({
			'width':'25%'
		});
		$('#question'+qID+' .subquestions-list input[type="text"]').css({
			'width':'90%'
		});
	});
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

Changing column width of array text 3 years 3 months ago #95338

  • Limer2001
  • Limer2001's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 18
  • Thank you received: 2
  • Karma: 0
Thank you it's working with the standard template I just need to make it work with my own...
Attachments:
The administrator has disabled public write access.

Changing column width of array text 3 years 3 months ago #95340

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6132
  • Thank you received: 1362
  • Karma: 535
That's because you have a JavaScript error - imagetick_lime.js is called before jQuery.

In startpage.pstpl, change this:
	<script type="text/javascript" src="{TEMPLATEURL}imagetick_lime.js"></script>	
	{TEMPLATEJS}

To this:
	{TEMPLATEJS}
	<script type="text/javascript" src="{TEMPLATEURL}imagetick_lime.js"></script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: Limer2001

Changing column width of array text 3 years 3 months ago #95342

  • Limer2001
  • Limer2001's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 18
  • Thank you received: 2
  • Karma: 0
Thank you!

The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.714 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form