Is there a way to create a generic html table in Django. I want to reuse the same form.html to display entities with different columns.
For example in the below code a pass a list of headers, and dynamically create the thead,but I need for each row in the body to get every value. So I need to iterate. Or is there any other approach to reuse templates in a mo generic way instead of build N templates for each table yuo need to display
<table class="table table-bordered" id="vendor_table" style="text-align: center;">
<thead class="tables-success">
<tr>
{% for header in list_headers %}
<th>{{ header }}</th>
{% endfor %}
</tr>
</thead>
{% for row in list_values %}
<tr>
{% for header_name in list_headers %}
<th> {{ row.{{ header_name }} }} </th> <---------
{% endfor %}
</tr>
{% endfor %}
</table>