2 {% load django_tables %}
4 <div class="table-container">
6 <table{% if table.attrs %} {{ table.attrs.as_html }}{% endif %}>
8 <tr class="{% cycle "odd" "even" %}">
9 {% for column in table.columns %}
10 {% if column.sortable %}
11 {% with column.order_by as ob %}
12 <th class="{% spaceless %}{% if column.sortable %}sortable {% endif %}{% if ob %}{% if ob.is_descending %}desc{% else %}asc{% endif %}{% endif %}{% endspaceless %}"><a href="{% if ob %}{% set_url_param sort=ob.opposite %}{% else %}{% set_url_param sort=column.name %}{% endif %}">{{ column.header }}</a></th>
15 <th>{{ column.header }}</th>
21 {% for row in table.page.object_list|default:table.rows %} {# support pagination #}
22 <tr class="{% cycle "odd" "even" %}">
31 <ul class="pagination">
32 {% if table.page.has_previous %}
33 <li class="previous"><a href="{% set_url_param page=table.page.previous_page_number %}">Previous</a>
35 <li class="current">Page {{ table.page.number }} of {{ table.paginator.num_pages }}</li>
36 {% if table.page.has_next %}
37 <li class="next"><a href="{% set_url_param page=table.page.next_page_number %}">Next</a>