Skip to main content

Djangotables is a simple library for generating html tables with Django Framework using model data like django forms.

Project description


Djangotables is a simple library for generating html tables with Django Framework using model data like django forms.

Djangotables is a simple yet powerful library. A library based on forms generated by Django, if you are already familiar with django forms it will be very easy to use django tables, otherwise it will be easy anyway :wink:

I had the idea of developing when I was developing a Dashboard and always had to write the tables several times in html :sleeping:


Simple djangotables can be installed with pip::

pip install djangotables


  • Python 3.6; 3.7
  • Django 2.0; 2.1; 2.2

These are the officially supported python and package versions. Other versions will probably work


It's very simple to use, you just have to import djangotables.tables on your file and create your subclass like below.

from djangotables import tables

class UserTable(tables.Table):
    first_name = tables.TextField(label="First Name")
    last_name  = tables.TextField(label="Last Name")

So, in your file, just import your table class and instantiate it by passing the queryset

from .tables import UserTable
from django.contrib.auth.models import User

from django.shortcuts import render

def index(request):

    table = UserTable( User.objects.all() )

    return render( request, "index.html", {
        "table": table

To finish, on your index.html template file you just have to do this

<!DOCTYPE html>
<html lang="en">
    <head> ... </head>
            {{ table | safe }}

Okay, this is how simple you can use djangotables to improve your daily development, feel free to contribute and help me make this little library bigger


Project details

Download files

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

Source Distribution

djangotables-0.0.3.tar.gz (5.2 kB view hashes)

Uploaded source

Built Distribution

djangotables-0.0.3-py3-none-any.whl (6.8 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page