skillfed

django-tables2

Table/data-grid framework for Django

django-tables2 v3.0.0 1.0M downloads/30d#4,498 on PyPI2,012
Permissive license All changes made to django-tables2 since forking from django-tables are Copyright (c) 2011, Bradley Ayers <http://bradleyayers.com> All rights reserved. Redistribution is permitted under the same… (full text in the JSON record) Active released

What it is and what it does

django-tables2 is a Django app that converts querysets and other iterables into rendered HTML tables with minimal boilerplate. It works by defining a Table subclass that declares columns and metadata, then passing that table class to a view mixin or template tag. The package handles pagination, column sorting, and template rendering without requiring JavaScript, and supports automatic table generation from Django models.

The package is designed for developers who need to display tabular data in Django templates. It reduces repetitive HTML generation and provides a declarative, model-like syntax familiar to Django users. It works with any iterable data source but has special integration with Django querysets, making it particularly useful for displaying database results with sorting and pagination controls.

Use it for:

  • Display a Django model's records in a paginated, sortable HTML table in an admin-like interface
  • Generate data grids from filtered querysets with automatic column rendering and pagination
  • Build custom table layouts by subclassing Table and defining column types and behaviors
  • Render querysets in templates without writing raw HTML loops or manual pagination logic
  • Create sortable, paginated reports from any iterable data source in a Django view

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

django-tables2 generates HTML tables from Django querysets and other iterables, with built-in pagination and column sorting, similar to how django.forms handles form generation.

Yes. django-tables2 is actively maintained, has no known vulnerabilities, carries a permissive BSD license, and solves a common Django problem with low install friction. It is well-suited for any Django project that needs to display tabular data with pagination and sorting.

Install

django-tables2 on PyPI

pip

pip install django-tables2

uv

uv add django-tables2

poetry

poetry add django-tables2

Installing django-tables2

Before you install

Low install friction with a single runtime dependency (django). Active maintenance with a recent release (123 days ago) and ongoing repository activity.

License in practice

BSD license (permissive). You may use, modify, and distribute the package freely in commercial and private projects, provided you retain the license notice.

Quickstart

# Install
pip install django-tables2

# In settings.py
INSTALLED_APPS = (..., "django_tables2")

# Define a table
import django_tables2 as tables
class MyTable(tables.Table):
    class Meta:
        model = MyModel

# In a view
class MyTableView(tables.SingleTableView):
    table_class = MyTable
    queryset = MyModel.objects.all()

# In template
{% load django_tables2 %}
{% render_table table %}

Requires Django and Python 3.10 or later; the package must be added to INSTALLED_APPS for template tags to work.

Verify before relying

  • Whether the package supports Django 5.2 and 6.0 in practice or only declares compatibility
  • Performance characteristics with large querysets or complex custom columns

Package facts

License All changes made to django-tables2 since forking from django-tables are Copyright (c) 2011, Bradley Ayers <http://bradleyayers.com> All rights reserved. Redistribution is permitted under the same… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — django
Maintenance actively maintained — 123 days since the last release
Last repo commit
First released
Downloads 1,017,635/month — #4,498 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_tables2-3.0.0-py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: WWW/HTTPTopic :: Software Development :: Libraries

Tags

django table generationhtml table from querysetdjango pagination sortingdata grid for djangodjango table renderingquerysets to html tablesdjango table framework
django-tableshtml-generation

More Libraries packages