title: How can I do line break in jinja2 python?
body: <p>How can I do line break in jinja2 in python?</p>
  
  <p>Below is my code</p>
  
  <pre><code>t1 = Template("{% for i in range(0, a1) %}|{{ mylist1[i] }}{% for j in range(0, (20 - (mylist1[i]|length))) %}{{ space }}{% endfor %}|{{ dicts[mylist1[i]][dicts[mylist1[i]].keys()[0]] }}{% for j in range(0, (20 - (dicts[mylist1[i]][dicts[mylist1[i]].keys()[0]]|length))) %}{{ space }}{% endfor %}|\n{{ string }}{% endfor %}")
  </code></pre>
  
  <p>This code will result in:
  <a href="https://i.stack.imgur.com/ZKCAZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZKCAZ.png" alt="enter image description here"></a>
  Since it is horizontally too long, I want to write them in few lines. </p>
  
  <p>However, If I do what I usually do in python like below:</p>
  
  <pre><code>t1 = Template("{% for i in range(0, a1) %}|\
                 {{ mylist1[i] }}\
                 {% for j in range(0, (20 - (mylist1[i]|length))) %}\
                      {{ space }}\
                 {% endfor %}|\
                 {{ dicts[mylist1[i]][dicts[mylist1[i]].keys()[0]] }}\
                 {% for j in range(0, (20 - (dicts[mylist1[i]][dicts[mylist1[i]].keys()[0]]|length))) %}\
                     {{ space }}\
                 {% endfor %}|\n\
                 {{ string }}\
                 {% endfor %}")
  </code></pre>
  
  <p>The result will be 
  <a href="https://i.stack.imgur.com/yRNoB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yRNoB.png" alt="enter image description here"></a></p>
  
  <p>Can anyone help me to solve this?</p>
  
  <p>Thank you.</p>