How to change table row on every fifth cell using while or for?
<p>Let's say we have a query that gives a result from database's records. I want to put those records on a table, but not like row after row. I would like to make a table that will change row on every fifth cell. How can I do this using <code>while</code> or <code>for</code>?</p>

<p>Here is just an example of what I have made for now, but I can't make it change row on every fifth cell...</p>

<pre><code>&lt;table&gt;
&lt;tr&gt;
&lt;?php $count = 0; while ($count &lt;= 5){ ?&gt;
&lt;td&gt;&lt;?php echo $id[$count]-&gt;id; $usrname[$count]-&gt;usrname;&lt;/td&gt;
&lt;?php $count++;}?&gt;
&lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>Any idea???</p>
