Navigation

  • index
  • next |
  • previous |
  • django-tables2 1.1.2 documentation »

PaginationΒΆ

Pagination is easy, just call Table.paginate() and pass in the current page number, e.g.

def people_listing(request):
    table = PeopleTable(Person.objects.all())
    table.paginate(page=request.GET.get('page', 1), per_page=25)
    return render(request, 'people_listing.html', {'table': table})

If you’re using RequestConfig, pass pagination options to the constructor, e.g.:

def people_listing(request):
    table = PeopleTable(Person.objects.all())
    RequestConfig(request, paginate={"per_page": 25}).configure(table)
    return render(request, 'people_listing.html', {'table': table})

Previous topic

Customising column headings

Next topic

Custom rendering

This Page

  • Show Source

Quick search

Enter search terms or a module, class or function name.

Navigation

  • index
  • next |
  • previous |
  • django-tables2 1.1.2 documentation »
© Copyright . Created using Sphinx 1.3.5.