[Answered ]-Prevent a list of names from splitting in a line break in a Django template

1👍

Something like this:

{% for name in list_of_names %}
   <div style="float: left">{{ name }}{%
     if forloop.counter0 %}, {% endif 
   %}</div>
{% endfor %}

1👍

I’d say create <span>s for each name; allow the spans to wrap, but not the text within them.

👤Ivo

Leave a comment