Note that there are some explanatory texts on larger screens.

plurals
  1. POShow <td> border in html only when there's a data in HTML using jQuery or Javascript?
    primarykey
    data
    text
    <p>I have a table like this in HTML:</p> <pre><code>&lt;table class="table table-bordered"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Tag&lt;/th&gt; &lt;th&gt;Time Code&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;{{ choice.tag1 }}&lt;/td&gt; &lt;td&gt;{{ choice.time_code1 }}&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;{{ choice.tag2 }}&lt;/td&gt; &lt;td&gt;{{ choice.time_code2 }}&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;{{ choice.tag3 }}&lt;/td&gt; &lt;td&gt;{{ choice.time_code3 }}&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;{{ choice.tag4 }}&lt;/td&gt; &lt;td&gt;{{ choice.time_code4 }}&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;{{ choice.tag5 }}&lt;/td&gt; &lt;td&gt;{{ choice.time_code5 }}&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;{{ choice.tag6 }}&lt;/td&gt; &lt;td&gt;{{ choice.time_code6 }}&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;{{ choice.tag7 }}&lt;/td&gt; &lt;td&gt;{{ choice.time_code7 }}&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;{{ choice.tag8 }}&lt;/td&gt; &lt;td&gt;{{ choice.time_code8 }}&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;{{ choice.tag9 }}&lt;/td&gt; &lt;td&gt;{{ choice.time_code9 }}&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;{{ choice.tag10 }}&lt;/td&gt; &lt;td&gt;{{ choice.time_code10 }}&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>The variable that I passed using <code>{{}}</code> most of the times are empty. Even if's it empty td is shown. I don't cut off the space and don't show any td's if they are empty. For example sometimes I may have data up to 3rd td only thus I want to show only up to 3rd td. Is this possible using jQuery or JavaScript?</p>
    singulars
    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.
 

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