Note that there are some explanatory texts on larger screens.

plurals
  1. POShow comma in html only if the variable has value using jquery?
    primarykey
    data
    text
    <p>I have a table like this:</p> <pre><code>&lt;table class="table table-bordered"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;&lt;/th&gt; &lt;th&gt;Project Name&lt;/th&gt; &lt;th&gt;Tape-ID&lt;/th&gt; &lt;th&gt;Video Type&lt;/th&gt; &lt;th&gt;Date Created&lt;/th&gt; &lt;th&gt;Director&lt;/th&gt; &lt;th&gt;Camera Person&lt;/th&gt; &lt;th&gt;Editor&lt;/th&gt; &lt;th&gt;Tag&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; {% load endless %} {% paginate 8 a %} {% for choice, i in a %} &lt;tr&gt; &lt;td&gt;&lt;input type="checkbox" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}" onchange="checkChecked()" /&gt;&lt;/td&gt; &lt;td&gt;{{ choice.name }}&lt;/td&gt; &lt;td&gt;{{ choice.tape_id }} &lt;/td&gt; &lt;td&gt;{{ choice.video_type }}&lt;/td&gt; &lt;td&gt;{{ i }}&lt;/td&gt; &lt;td&gt;{{ choice.director }}&lt;/td&gt; &lt;td&gt;{{ choice.cameraman }}&lt;/td&gt; &lt;td&gt;{{ choice.editor }}&lt;/td&gt; &lt;td&gt;{{ choice.tag1 }}, {{ choice.tag2 }}, {{ choice.tag3 }}, {{ choice.tag4 }}, {{ choice.tag5 }}, {{ choice.tag6 }}, {{ choice.tag7 }}, {{ choice.tag8 }}, {{ choice.tag9 }}, {{ choice.tag10 }} &lt;/td&gt; &lt;/tr&gt; {% endfor %} &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>These variable <code>{{ choice...}}</code> 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:</p> <pre><code>water, pollution, hello, , , , , , </code></pre> <p>I don't want to show comma if there's no value. How can I do this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload