NPS Colorscale in Limesurvey?

More
1 month 2 weeks ago #186374 by elissa
Hi Colleagues,

The script added by Tony above: www.limesurvey.org/forum/can-i-do-this-w...in-limesurvey#183356 works perfectly for me (LS 3.17.7+190627). However, I would like to change the width of the first and the last column to be wider than others (to better fit the text what is an issue in my language). How can I set variable column widths in the array?

Thanks

Elzbieta Lesinska
LS voluntary Polish translator and supervisor

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago - 1 month 2 weeks ago #186378 by tpartner
Hi Elzbieta,

Try something like this for the CSS - see where I reset the column widths in rows 3-5 and then define new widths in rows 13-28.

Note that the new widths should add up to 100%.

<style type="text/css">
 
	.custom-array table.subquestion-list col {
		width: auto !important;
	}
 
	.custom-array table.subquestion-list thead td,
	.custom-array table.subquestion-list thead th {
		border-bottom-width: 8px;
		border-bottom-style: solid;
	}
 
	.custom-array table.subquestion-list thead .column-0 { 
		padding: 0; 
		width: 0;
	}
 
	.custom-array table.subquestion-list thead .column-1 { border-bottom-color: #00A800; width: 23%; }
	.custom-array table.subquestion-list thead .column-2 { border-bottom-color: #5AC100; width: 6%; }
	.custom-array table.subquestion-list thead .column-3 { border-bottom-color: #9DD600; width: 6%; }
	.custom-array table.subquestion-list thead .column-4 { border-bottom-color: #9CE400; width: 6%; }
	.custom-array table.subquestion-list thead .column-5 { border-bottom-color: #E2EC00; width: 6%; }
	.custom-array table.subquestion-list thead .column-6 { border-bottom-color: #ECEC00; width: 6%; }
	.custom-array table.subquestion-list thead .column-7 { border-bottom-color: #ECE200; width: 6%; }
	.custom-array table.subquestion-list thead .column-8 { border-bottom-color: #E4C900; width: 6%; }
	.custom-array table.subquestion-list thead .column-9 { border-bottom-color: #D69D00; width: 6%; }
	.custom-array table.subquestion-list thead .column-10 { border-bottom-color: #C15A00; width: 6%; }
	.custom-array table.subquestion-list thead .column-11 { border-bottom-color: #A80200; width: 23%; }
 
	.custom-array td.column-1:hover,
	.custom-array td.active-item.column-1 { background-color: #00A800; }
 
	.custom-array td.column-2:hover,
	.custom-array td.active-item.column-2 { background-color: #5AC100; }
 
	.custom-array td.column-3:hover,
	.custom-array td.active-item.column-3 { background-color: #9DD600; }
 
	.custom-array td.column-4:hover,
	.custom-array td.active-item.column-4 { background-color: #9CE400; }
 
	.custom-array td.column-5:hover,
	.custom-array td.active-item.column-5 { background-color: #E2EC00; }
 
	.custom-array td.column-6:hover,
	.custom-array td.active-item.column-6 { background-color: #ECEC00; }
 
	.custom-array td.column-7:hover,
	.custom-array td.active-item.column-7 { background-color: #ECE200; }
 
	.custom-array td.column-8:hover,
	.custom-array td.active-item.column-8 { background-color: #E4C900; }
 
	.custom-array td.column-9:hover,
	.custom-array td.active-item.column-9 { background-color: #D69D00; }
 
	.custom-array td.column-10:hover,
	.custom-array td.active-item.column-10 { background-color: #C15A00; }
 
	.custom-array td.column-11:hover,
	.custom-array td.active-item.column-11 { background-color: #A80200; }
</style>


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:
Last edit: 1 month 2 weeks ago by tpartner.
The following user(s) said Thank You: elissa

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #186379 by elissa
Perfect. As usual.
Thank you very much, Tony.

Elzbieta Lesinska
LS voluntary Polish translator and supervisor

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!