Display items from a list in the Django html

Asked

Viewed 186 times

-1

My code is this::

{% for item in saldo %}
{{item}}
{% endfor %}

And I would like to present the numbers (in the image), each in each row. Does anyone know how? I tried to do a "for" inside the posted but it doesn’t work.

inserir a descrição da imagem aqui inserir a descrição da imagem aqui

  • Can you post the template for this part? Just so we know if this is supposed to be a list or table

  • I’ve solved it, thank you!

  • Great! Because it shares the solution :P can have other people in the future with a similar problem. Publish as the answer and mark as the right one :)

2 answers

0

Try trading the code for this:

{% for item in saldo %}
  <div>{{item}}</div>
{% endfor %}

I’ve never dealt with Django, but I imagine that can solve.

  • all results appear in the same cell. (I put a print in the question)

0

Tries to add a line break:

{{item}} <br/>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.