Check out the LimeSurvey source code on GitHub!

How to change question display.

More
5 years 6 months ago #63962 by frankieh
Hi all,

One of my users wants to change the centering of table cells in questions in her survey.

Specifically, she wants change the alignment of the strongly disagree/disagree/slightly disagree/neither agree nor disagree etc etc radio boxes from left aligned to center.

I can't find the CSS for those cells in the template file and if I add them it is overridden by something else.

The table cells and other relevant elements appear to be dynamically calles.
For example, the td cells are classed:
answer_cell_001 answer_cell_002 etc.

The ID of the radio buttons themselves is:
answer88995x618x9506expy3-1

Cannot find a way to change the alignment of all the radio boxes to center in their cells.

Can anyone give me any pointers?


regards

Frank

Please Log in to join the conversation.

More
5 years 6 months ago #63972 by DenisChenu
Hello,

Can you tell us what is the template you use ?

You can have a look at docs.limesurvey.org/tiki-index.php?page=...g_questions_with_CSS

For a specific question, ( question number 42 for the example)
#question42 .answer td{text-align:center}
For all gender question
.gender .answer td{text-align:center}

But maybe there are some specific problem/modification with your template.

:)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
5 years 6 months ago #64051 by frankieh
Hi Shnoulle,

Thanks for responding..

The template was based on the default 91 template with few changes so it shouldn't be the issue.

this is one of the questions we wanted to center align the radio boxes. (but all radio boxes, not just the one question.
<table class="question" summary="
	Please specify to what extent the following statements fit the innovation strategy in your company.
 - an array type question" >
	<colgroup class="col-responses">
	<col class="col-answers" width="50%" />
<col class="odd" width="6.3%" />
<col class="even" width="6.3%" />
<col class="odd" width="6.3%" />
<col class="even" width="6.3%" />
<col class="odd" width="6.3%" />
<col class="even" width="6.3%" />
 
<col class="odd" width="6.3%" />
<col class="col-no-answer even" width="6.3%" />
	</colgroup>
	<thead>
<tr>
	<td>&nbsp;</td>
	<th>Strongly Disagree</th>
	<th>Disagree</th>
	<th>Slightly Disagree</th>
 
	<th>Neither Agree nor Disagree</th>
	<th>Slightly Agree</th>
	<th>Agree</th>
	<th>Strongly Agree</th>
	<th>No answer</th>
</tr>
	</thead>
 
 
 
 
	<tbody id='javatbd88995X618X9506EXPY1'>
<tr class="array2">
	<th class="answertext">
Out unit accepts demands that go beyond existing products and services<input type='hidden' name='tbdisp88995X618X9506EXPY1' id='tbdisp88995X618X9506EXPY1' value='on' />
<input type="hidden" name="java88995X618X9506EXPY1" id="java88995X618X9506EXPY1" value="" />
	</th>
			<td class="answer_cell_001">
<label for="answer88995X618X9506EXPY1-1">
	<input class="radio" type="radio" name="88995X618X9506EXPY1" value="1" id="answer88995X618X9506EXPY1-1" title="Strongly Disagree" onclick="noop_checkconditions(this.value, this.name, this.type)" />
</label>
 
	</td>
			<td class="answer_cell_002">
<label for="answer88995X618X9506EXPY1-2">
	<input class="radio" type="radio" name="88995X618X9506EXPY1" value="2" id="answer88995X618X9506EXPY1-2" title="Disagree" onclick="noop_checkconditions(this.value, this.name, this.type)" />
</label>
	</td>
			<td class="answer_cell_003">
<label for="answer88995X618X9506EXPY1-3">
	<input class="radio" type="radio" name="88995X618X9506EXPY1" value="3" id="answer88995X618X9506EXPY1-3" title="Slightly Disagree" onclick="noop_checkconditions(this.value, this.name, this.type)" />
</label>
	</td>
 
			<td class="answer_cell_004">
<label for="answer88995X618X9506EXPY1-4">
	<input class="radio" type="radio" name="88995X618X9506EXPY1" value="4" id="answer88995X618X9506EXPY1-4" title="Neither Agree nor Disagree" onclick="noop_checkconditions(this.value, this.name, this.type)" />
</label>
	</td>
			<td class="answer_cell_005">
<label for="answer88995X618X9506EXPY1-5">
	<input class="radio" type="radio" name="88995X618X9506EXPY1" value="5" id="answer88995X618X9506EXPY1-5" title="Slightly Agree" onclick="noop_checkconditions(this.value, this.name, this.type)" />
</label>
	</td>
			<td class="answer_cell_006">
 
<label for="answer88995X618X9506EXPY1-6">
	<input class="radio" type="radio" name="88995X618X9506EXPY1" value="6" id="answer88995X618X9506EXPY1-6" title="Agree" onclick="noop_checkconditions(this.value, this.name, this.type)" />
</label>
	</td>
			<td class="answer_cell_007">
<label for="answer88995X618X9506EXPY1-7">
	<input class="radio" type="radio" name="88995X618X9506EXPY1" value="7" id="answer88995X618X9506EXPY1-7" title="Strongly Agree" onclick="noop_checkconditions(this.value, this.name, this.type)" />
</label>
	</td>
	<td>
<label for="answer88995X618X9506EXPY1-">
 
	<input class="radio" type="radio" name="88995X618X9506EXPY1" value="" id="answer88995X618X9506EXPY1-" title="No answer" checked="checked" onclick="noop_checkconditions(this.value, this.name, this.type)"  />
</label>
	</td>
</tr>

I tried adding this to the template.css:
.answer td{text-align:center;}

but it made no difference. (at least as tested by firefox 5)

will keep trying stuff unless you have another suggestion?

many thanks

regards

Frank
University of Western Australia.

Please Log in to join the conversation.

More
5 years 6 months ago - 5 years 6 months ago #64067 by tpartner
But...in the default template the radio cells are already text-aligned center:



Or do you want to center the sub-question labels too:
table.question tbody th {
    text-align: center !important;
}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last Edit: 5 years 6 months ago by tpartner.

Please Log in to join the conversation.

More
5 years 6 months ago #64122 by frankieh
Thanks heaps.. turns out it was caused by an old copy of template.css

I was wondering who made the decision not to center it... seeemed strange.. turns out nobody did.

thanks again

Frank

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form