Welcome, Guest
Username: Password: Remember me

TOPIC: How to change question display.

How to change question display. 3 years 3 months ago #63962

  • frankieh
  • frankieh's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
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
The administrator has disabled public write access.

Re: How to change question display. 3 years 3 months ago #63972

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6471
  • Thank you received: 854
  • Karma: 254
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.

:)
The administrator has disabled public write access.

Re: How to change question display. 3 years 3 months ago #64051

  • frankieh
  • frankieh's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
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.
The administrator has disabled public write access.

Re: How to change question display. 3 years 3 months ago #64067

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4293
  • Thank you received: 810
  • Karma: 373
But...in the default template the radio cells are already text-aligned center:

Capture_2011-07-29.JPG


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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 3 years 3 months ago by tpartner.
The administrator has disabled public write access.

Re: How to change question display. 3 years 2 months ago #64122

  • frankieh
  • frankieh's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
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
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.236 seconds
Donation Image