I have a table like this:
<table class="table table-bordered">
<thead>
<tr>
<th></th>
<th>Project Name</th>
<th>Tape-ID</th>
<th>Video Type</th>
<th>Date Created</th>
<th>Director</th>
<th>Camera Person</th>
<th>Editor</th>
<th>Tag</th>
</tr>
</thead>
<tbody>
{% load endless %}
{% paginate 8 a %}
{% for choice, i in a %}
<tr>
<td><input type="checkbox" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}" onchange="checkChecked()" /></td>
<td>{{ choice.name }}</td>
<td>{{ choice.tape_id }} </td>
<td>{{ choice.video_type }}</td>
<td>{{ i }}</td>
<td>{{ choice.director }}</td>
<td>{{ choice.cameraman }}</td>
<td>{{ choice.editor }}</td>
<td>{{ choice.tag1 }}, {{ choice.tag2 }}, {{ choice.tag3 }}, {{ choice.tag4 }},
{{ choice.tag5 }}, {{ choice.tag6 }}, {{ choice.tag7 }}, {{ choice.tag8 }},
{{ choice.tag9 }}, {{ choice.tag10 }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
These variable {{ choice...}}
may or may not have value. It is sequential though. The variable upto 3 can have values and none of have values after 3. If there's no value it comes like this:
water, pollution, hello, , , , , ,
I don't want to show comma if there's no value. How can I do this?
See Question&Answers more detail:os