#1 by spurl
Hi All, I want to essentially recreate the example from the oTree Documentation (https://otree.readthedocs.io/en/latest/forms.html#example-radio-buttons-arranged-like-a-slider) but I want there to be labels below or above each radio button with a label for it's value (for example, on the documentation example it would have -3, -2, ..., 2, 3 written above each respective radio button). Any tips on how to do this? Thanks!
#2
by
BonnEconLab
One way to place the values below or above the respective radio button would be using a table.
Here’s an example:
<p>{{ form.pizza.label }}</p>
<table>
<tr>
<td></td>
{% for label in form.pizza.choices %}
<td style="text-align: center; width: 2.5em; color: gray;">{{ label }}</td>
{% endfor %}
<td></td>
</tr>
<tr>
<td>Not at all </td>
{% for radio in form.pizza %}
<td style="text-align: center;">{{ radio }}</td>
{% endfor %}
<td> Very much</td>
</tr>
</table>