Line break \n doesn't work in a form's label?

202 views
Skip to first unread message

Pei-Hsun

unread,
May 25, 2022, 11:39:53 PM5/25/22
to oTree help & discussion
Hi all,

I want to have a line break in a label of a form. In a form, I use something like

label='example\n question'

but "example" and "question" are still in the same line. Is there any way to make it work?

Thanks,
Pei-Hsun

Chris Crabbe

unread,
May 26, 2022, 12:08:51 AM5/26/22
to Pei-Hsun, oTree help & discussion
Hi Pei-Hsun -

Formatting is not enabled in the 'label' of a model field.  The way I do this is by setting label='' and then hand-coding the formatting in the template, like:

Example<br>question
{{ formfield 'fieldname' }}

Thanks,
--Chris

--
You received this message because you are subscribed to the Google Groups "oTree help & discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to otree+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/otree/5e6c63bd-40e0-4e50-8db2-044ba3e05c0cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages