I would like to create a table with django-tables2 such that different rows have different properties.
By default I get either
<tr class="odd">
or
<tr class="even">
How can I specify my own class for some of the rows?
Similarly, if I have a CheckBoxColumn and I specify some data for this column, it goes into the value:
<input type="checkbox" name="col" value="123"/>
This is great for figuring out which checkbox was checked. However, how can I set some checkboxes as checked when the table is created?
My scenario: the user picks some rows from a large table. For example, the table has
- orange 1
- orange 2
- apple 5
- orange 3
- apple 4
- cucumber 7
- aaple 1
The user picks aaple 5 and cucumber 7.
Then I would like to display all apples and all cucumbers, since the user picked at least one apple and at least one cucumber. This allows the user to see other relevant entries:
- apple 5
- apple 4
- cucumber 7
However, I would like to highlight the entries actually picked by the user by using css and/or by displaying a checked checkbox:
- apple 5
- apple 4
- cucumber 7