{% spaceless %}
{% load django_tables %}
+{% if table.page %}
+<div class="table-container">
+{% endif %}
<table{% if table.attrs %} {{ table.attrs.as_html }}{% endif %}>
<thead>
<tr class="{% cycle "odd" "even" %}">
<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>
{% endwith %}
{% else %}
- <th>{{ column.verbose_name }}</th>
+ <th>{{ column.header }}</th>
{% endif %}
{% endfor %}
</tr>
</thead>
<tbody>
- {% for row in table.rows %}
+ {% for row in table.page.object_list|default:table.rows %} {# support pagination #}
<tr class="{% cycle "odd" "even" %}">
{% for cell in row %}
<td>{{ cell }}</td>
{% endfor %}
</tbody>
</table>
+{% if table.page %}
+<ul class="pagination">
+ {% if table.page.has_previous %}
+ <li class="previous"><a href="{% set_url_param page=table.page.previous_page_number %}">Previous</a>
+ {% endif %}
+ <li class="current">Page {{ table.page.number }} of {{ table.paginator.num_pages }}</li>
+ {% if table.page.has_next %}
+ <li class="next"><a href="{% set_url_param page=table.page.next_page_number %}">Next</a>
+ {% endif %}
+ </span>
+</div>
+</div>
+{% endif %}
{% endspaceless %}