{% extends "admin/base_site.html" %} {% load i18n %} {% block bodyclass %}grp-doc{% endblock %} {% block content-class %}{% endblock %} {% block title %}Grappelli Documentation » Tables{% endblock %} {% block extrahead %} {% endblock %} {% block breadcrumbs %}
Feel free to use everything a table structure allows. To cycle the background-color of rows, use the classes .grp-row-even and .grp-row-odd.
Just add .grp-full-width.
{% filter force_escape %}
...
{% endfilter %}
Tables may be sortable (e.g. with change-lists) — to do so, add the class .grp-sortable to the table. To define a th as a sortable header, you have to add .sortable. If it's already sorted, you further have to add .sorted.ascending or .sorted.descending.
Each th in a sortable table has to contain one or more of the following elements:
To view the full code of a sortable table take a look at Grappellis change_list_results.html.
{% filter force_escape %}
Surname
Stuff
Smith
Violin
5
.
.
.
{% endfilter %}
You may use all types of form fields in tables as well as error elements.
Non-form error with some instruments
Prename | Surname | Instrument | Action |
---|---|---|---|
|
|||
Stuff | Smith | Violin |
|
Stéphane | Grappelli | Violin | |
Joe | Venuti | Violin | |
|
|||
Eddie | South | Violin |
|
Django | Reinhardt | Guitar |
{% filter force_escape %}
Prename
Surname
Instrument
Action
- Non-field error with Stuffs Violin
Stuff
Smith
Violin
- Field error: Tuning failed
- Field error: Not able to tune it up
.
.
.
{% endfilter %}