Skip to main content

django-tables2 - An app for creating HTML tables

Latest PyPI version Any color you like

django-tables2 simplifies the task of turning sets of data into HTML tables. It has native support for pagination and sorting. It does for HTML tables what django.forms does for HTML forms. e.g.

Features:

  • Any iterable can be a data-source, but special support for Django QuerySets is included.
  • The builtin UI does not rely on JavaScript.
  • Support for automatic table generation based on a Django model.
  • Supports custom column functionality via subclassing.
  • Pagination.
  • Column based table sorting.
  • Template tag to enable trivial rendering to HTML.
  • Generic view mixin.

An example table rendered using django-tables2

An example table rendered using django-tables2 and bootstrap theme

An example table rendered using django-tables2 and semantic-ui theme

Example

Start by adding django_tables2 to your INSTALLED_APPS setting like this:

INSTALLED_APPS = (
    ...,
    "django_tables2",
)

Creating a table for a model Simple is as simple as:

import django_tables2 as tables

class SimpleTable(tables.Table):
    class Meta:
        model = Simple

This would then be used in a view:

class TableView(tables.SingleTableView):
    table_class = SimpleTable
    queryset = Simple.objects.all()
    template_name = "simple_list.html"

And finally in the template:

{% load django_tables2 %}
{% render_table table %}

This example shows one of the simplest cases, but django-tables2 can do a lot more! Check out the documentation for more details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_tables2-3.0.1.tar.gz (130.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_tables2-3.0.1-py3-none-any.whl (96.4 kB view details)

Uploaded Python 3

File details

Details for the file django_tables2-3.0.1.tar.gz.

File metadata

  • Download URL: django_tables2-3.0.1.tar.gz
  • Upload date:
  • Size: 130.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.18.0 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"15.5"},"implementation":{"name":"CPython","version":"3.14.6"},"installer":{"name":"hatch","version":"1.18.0"},"openssl_version":"OpenSSL 3.6.3 9 Jun 2026","python":"3.14.6","system":{"name":"Darwin","release":"24.5.0"}} HTTPX2/2.12.0

File hashes

Hashes for django_tables2-3.0.1.tar.gz
Algorithm Hash digest
SHA256 5a8b51b6c18ce5ec4edd4d0f23c55a8b15590854168b2e5c734118ee369dcbfd
MD5 a53e8d1338950907a842bee2e1373c54
BLAKE2b-256 87c4ac3eee8fb075e0b945452780f876cdad72caff38dba84df7df42c9cc8763

See more details on using hashes here.

File details

Details for the file django_tables2-3.0.1-py3-none-any.whl.

File metadata

  • Download URL: django_tables2-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 96.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.18.0 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"15.5"},"implementation":{"name":"CPython","version":"3.14.6"},"installer":{"name":"hatch","version":"1.18.0"},"openssl_version":"OpenSSL 3.6.3 9 Jun 2026","python":"3.14.6","system":{"name":"Darwin","release":"24.5.0"}} HTTPX2/2.12.0

File hashes

Hashes for django_tables2-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cfabaeeb4b5c4df0844ab0b3f634263deeb131ba2f3174fa5d3e15975047e881
MD5 f02817e7b2b651756e6bebcc62116037
BLAKE2b-256 43e76a75201123d94d0644588b40cc759dc88df50fa917d121046de5b182ec43

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.0.1 This release

2 files

3.0.0

2 files

2.9.0

2 files

2.8.0

2 files

2.7.5

2 files

2.7.4

2 files

2.7.3

2 files

2.7.2

2 files

2.7.1

2 files

2.7.0

2 files

2.6.0

2 files

2.5.3

2 files

2.5.2

2 files

2.5.1

2 files

2.5.0

2 files

2.4.1

2 files

2.4.0

2 files

2.3.4

2 files

2.3.3

2 files

2.3.2

2 files

2.3.1

2 files

2.3.0

2 files

2.2.1

2 files

2.2.0

2 files

2.1.1

2 files

2.1.0

2 files

2.0.6

2 files

2.0.5

2 files

2.0.4

2 files

2.0.3

2 files

2.0.2

1 file

2.0.1

1 file

2.0.0

1 file

1.21.2

1 file

1.21.1

1 file

1.21.0

1 file

1.20.0

1 file

1.19.0

1 file

1.18.0

1 file

1.17.1

1 file

1.17.0

1 file

1.16.0

1 file

1.15.0

1 file

1.14.2

1 file

1.14.1

1 file

1.14.0

1 file

1.13.0

1 file

1.12.0

1 file

1.11.0

1 file

1.10.0

1 file

1.9.1

1 file

1.9.0

1 file

1.8.0

1 file

1.7.1

1 file

1.7.0

1 file

1.6.1

1 file

1.6.0

1 file

1.5.0

1 file

1.4.2

1 file

1.4.1

1 file

1.4.0

1 file

1.3.0

1 file

1.2.9

1 file

1.2.8

1 file

1.2.7

1 file

1.2.6

1 file

1.2.5

1 file

1.2.4

1 file

1.2.3

1 file

1.2.2

1 file

1.2.1

1 file

1.2.0

1 file

1.1.8

1 file

1.1.7

1 file

1.1.6

1 file

1.1.5

1 file

1.1.4

1 file

1.1.3

1 file

1.1.2

1 file

1.1.1

1 file

1.1.0

1 file

1.0.7

1 file

1.0.6

1 file

1.0.5

1 file

1.0.4

1 file

1.0.3

1 file

1.0.2

1 file

1.0.1

1 file

1.0.0

1 file

0.16.0

1 file

0.15.0

1 file

0.14.0

1 file

0.13.0

1 file

0.12.1

1 file

0.12.0

1 file

0.11.0

1 file

0.10.4

1 file

0.10.3

1 file

0.10.2

1 file

0.10.1

1 file

0.10.0

1 file

0.9.6

1 file

0.9.5

1 file

0.9.4

1 file

0.9.3

1 file

0.9.2

1 file

0.9.1

1 file

0.8.4

1 file

0.8.3

1 file

0.8.2

1 file

0.8.1

1 file

0.8.0

1 file

0.7.8

1 file

0.7.7

1 file

0.7.6

1 file

0.7.5

1 file

0.7.4

1 file

0.7.3

1 file

0.7.2

1 file

0.7.1

1 file

0.7.0

1 file

0.6.1

1 file

0.6.0

1 file

0.6.0.dev

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page