HTML Print Format Reverse Table

you can ignore the loop.index and create an index of your own .
before the loop assign a variable with the length of the items . on each row you can show it and then change it minus 1 .
example :

{% set i=[doc.review_table | length]%}

{%- for row in doc.review_table -%}
tr
<td {{i[0]}} /td
{% if i.append(i.pop()-1) -%}{% endif %}
<td {{ row.issued_for }} /td
<td {{ row.prepared_by }} /td
<td {{ row.checked_by }} /td
<td {{ row.date }} /td
/tr

1 Like