PHP: End and start a new <tr> after 6 rows
<p>I want to make a table, and then for each 6 rows should have a tr, and then the rows are inside td.</p>

<p>So example:</p>

<pre><code>&lt;tr&gt;
&lt;td&gt;&lt;?php echo $show[id]; ?&gt;&lt;/td&gt; // 1
&lt;td&gt;&lt;?php echo $show[id]; ?&gt;&lt;/td&gt; // 2
&lt;td&gt;&lt;?php echo $show[id]; ?&gt;&lt;/td&gt; // 3
&lt;td&gt;&lt;?php echo $show[id]; ?&gt;&lt;/td&gt; // 4
&lt;td&gt;&lt;?php echo $show[id]; ?&gt;&lt;/td&gt; // 5
&lt;td&gt;&lt;?php echo $show[id]; ?&gt;&lt;/td&gt; // 6
&lt;/tr&gt; &lt;tr&gt; // start new tr after 6 rows
...repeat the tds
</code></pre>

<p>How can i do something like this?
I have tried myself doing</p>

<pre><code>&lt;tr&gt; 
&lt;?php
while ($show == mysql_fetch_array($query)){ ?&gt;
&lt;td&gt;&lt;?php echo $show[id]; ?&gt;&lt;/td&gt;
&lt;?php } ?&gt;
&lt;/tr&gt;
</code></pre>

<p>But as you can see this just inserts everything in one tr..</p>

<p>Thank you</p>
