79730601

Date: 2025-08-09 12:05:25
Score: 1
Natty:
Report link

There was nothing special in the template file but the variable "unit" holding the datum, and a for loop to distribute it's elements to one html table.

Here is how template looks like:


<tbody>

    {% for element in unit %}
                        
    <tr>
    
        <td>{{ element[0] }} </td>
                        
        <td>{{ element[1] }}</td>

        <td>{{ element[2] }}</td>
                        
    </tr>
                        
    {% endfor %}

</tbody>

Thank you all, who are writing suggestions. I have found the solution to define an empty list such as unit_result, populating the list item with a loop and sending it to the template.


#prepare for the table
unit_result = []
for i in range(len(unit)):
    unit_result.append((unit[i][0], unit[i][1], unit[i][2]))
    
return render_template('analysis.html', unit_result=unit_result)

The new template will include the following line instead of the older one:

{% for element in unit_result %}
Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: QuestionsAndAnswers