1 ================================================
2 django-tables2 - An app for creating HTML tables
3 ================================================
7 Prior to v0.6.0 this package was a fork of miracle2k's and both were known
8 as *django-tables*. This caused some problems (e.g. ambiguity and inability
9 to put this library on PyPI) so as of v0.6.0 this package is known as
12 django-tables2 simplifies the task of turning sets of data into HTML tables. It
13 has native support for pagination and sorting. It does for HTML tables what
14 ``django.forms`` does for HTML forms.
16 Creating a table is as simple as::
18 import django_tables2 as tables
20 class SimpleTable(tables.Table):
24 This would then be used in a view::
26 def simple_list(request):
27 queryset = Simple.objects.all()
28 table = SimpleTable(queryset)
29 return render_to_response("simple_list.html", {"table": table},
30 context_instance=RequestContext(request))
32 And finally in the template::
34 {% load django_tables2 %}
35 {% render_table table %}
38 This example shows one of the simplest cases, but django-tables2 can do a lot
39 more! Check out the `documentation`__ for more details.
41 .. __: http://django-tables2.readthedocs.org/en/latest/
44 Building the documentation
45 ==========================
47 If you want to build the docs from within a virtualenv, use::
49 make html SPHINXBUILD="python $(which sphinx-build)"