table

{% load table_tags %} <table class=""> <thead class=""> <tr> {% for field in fields %}<th class="">{{ field }}</th>{% endfor %} </tr> </thead> <tbody class=""> {% comment %} {% for piece in queryset %} <tr class=""> {% for field in fields %}<td class="p-2">{{ piece|get_field:field }}</td>{% endfor %} </tr> {% endfor %} {% endcomment %} {% partialdef table_rows %} {% for piece in queryset %} <tr class="" {% if forloop.last and page_obj.has_next %} hx-get="{% url 'captures:new_words' %}?page={{ page_obj.next_page_number }}" hx-target="tbody" hx-swap="beforeend" hx-trigger="intersect once" {% endif %}> {% for field in fields %}<td class="p-2">{{ piece|get_field:field }}</td>{% endfor %} </tr> {% endfor %} {% endpartialdef %} {% partial table_rows %} </tbody> </table>