How to create a new table row after every 4 cells within a forloop in JavaScript?
<p>Not sure how to use the modulus operator to achieve this:</p>

<pre><code>&lt;table border="1"&gt;
&lt;tr&gt;

for (i = 0; i &lt; someVar.length; i++) {

   if (i % 4) document.write('&lt;/tr&gt;&lt;tr&gt;');

   document.write('&lt;td&gt;Hi&lt;/td&gt;'+i):

}

&lt;/tr&gt;
&lt;/table&gt;
</code></pre>
