سؤال

I used django_tables2(http://django-tables2.readthedocs.org/en/latest/) for HTML tables rendering, but my template failed to work:

{% extends 'base.html' %}
{% block main %}
    {% render_table table %} 
{% endblock %}

The error message as following:

Invalid block tag: 'render_table', expected 'endblock'

And is there any alternative to the above tables2 plugin?

هل كانت مفيدة؟

المحلول

The docs states that You must include the following declaration before loading anything:

{% load render_table from django_tables2 %}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top