{% extends "base.html" %}


{% block body %}
<h1><tt>django-tables2</tt> examples</h1>
<p>This page demonstrates various types of tables being rendered via
<tt>django-tables2</tt>.</p>

<h2>Example 1 — QuerySet</h2>
<h3>via <tt>as_html()</tt></h3>
<pre>{% templatetag openvariable %} example1.as_html {% templatetag closevariable %}</pre>
{{ example1.as_html }}

<h3>via template tag</h3>
<pre>{% templatetag openblock %} load django_tables2 {% templatetag closeblock %}
{% templatetag openblock %} render_table example1 {% templatetag closeblock %}</pre>
{% load django_tables2 %}
{% render_table example1 %}

<h2>Example 2 — QuerySet + pagination</h2>
<h3>via <tt>as_html()</tt></h3>
<pre>{% templatetag openvariable %} example2.as_html {% templatetag closevariable %}</pre>
{{ example2.as_html }}

<h3>via template tag</h3>
<pre>{% templatetag openblock %} load django_tables2 {% templatetag closeblock %}
{% templatetag openblock %} render_table example2 {% templatetag closeblock %}</pre>
{% load django_tables2 %}
{% render_table example2 %}

<h2>Example 3 — QuerySet + paleblue theme</h2>
<h3>via <tt>as_html()</tt></h3>
<pre>{% templatetag openvariable %} example3.as_html {% templatetag closevariable %}</pre>
{{ example3.as_html }}

<h3>via template tag</h3>
<pre>{% templatetag openblock %} load django_tables2 {% templatetag closeblock %}
{% templatetag openblock %} render_table example3 {% templatetag closeblock %}</pre>
{% load django_tables2 %}
{% render_table example3 %}

<h2>Example 4 — QuerySet + pagination + paleblue theme</h2>
<h3>via <tt>as_html()</tt></h3>
<pre>{% templatetag openvariable %} example4.as_html {% templatetag closevariable %}</pre>
{{ example4.as_html }}

<h3>via template tag</h3>
<pre>{% templatetag openblock %} load django_tables2 {% templatetag closeblock %}
{% templatetag openblock %} render_table example4 {% templatetag closeblock %}</pre>
{% load django_tables2 %}
{% render_table example4 %}

<h2>Example 5 – QuerySet + pagination + paleblue theme + custom template</h2>
<h3>via <tt>as_html()</tt></h3>
<pre>{% templatetag openvariable %} example5.as_html {% templatetag closevariable %}</pre>
{{ example5.as_html }}

<h3>via template tag</h3>
<pre>{% templatetag openblock %} load django_tables2 {% templatetag closeblock %}
{% templatetag openblock %} render_table example5 {% templatetag closeblock %}</pre>
{% load django_tables2 %}
{% render_table example5 %}
{% endblock %}
