'How to avoid for loop statement in the HTML code in Jinja2 to be not printed in the webpage
I have tried to form a table and iterate through the table in HTML and JINJA2
<body>
<form method ="post">
<label>Voter ID</label>
<input name = "u">
<button>Login</button>
</form>
<table style="width:100%">
<tr>
<th style="text-align:left">Public Ledger</th>
</tr>
<tr>
{% for item in public_ledger %}
<tr>
{% for i in item %}
<td>{{i}}</td>
{% endfor %}
</tr>
{% endfor %}
</tr>
</table>
</body>
</html>
Not able to add an output image so the output description is as follows These statements get printed on the webpage as shown below
% for item in public_ledger % % for i in item % % endfor % % endfor %
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
