Search code examples
djangodjango-tables2

How to hide/show columns according to user input using django-tables2


I have a table with many columns (and rows), which I render using {% render_table table_all %} in a html template of my django app. I want to display certain columns and give the user the choice to show additional columns (using f.ex. a checkbox or drop-down menu).

Is this possible with django-tables2? Or do I have to use javascript?


Solution

  • Maybe django-tables2-column-shifter suits your needs? It adds some custom Javascript/templating to allow turning columns on an off:

    screenshot for django-tables2-column-shifter