PHP: End and start a new <tr> after 6 rows

thanhcongit

New Member
I want to make a table, and then for each 6 rows should have a tr, and then the rows are inside td.So example:\[code\]<tr><td><?php echo $show[id]; ?></td> // 1<td><?php echo $show[id]; ?></td> // 2<td><?php echo $show[id]; ?></td> // 3<td><?php echo $show[id]; ?></td> // 4<td><?php echo $show[id]; ?></td> // 5<td><?php echo $show[id]; ?></td> // 6</tr> <tr> // start new tr after 6 rows...repeat the tds\[/code\]How can i do something like this?I have tried myself doing\[code\]<tr> <?phpwhile ($show == mysql_fetch_array($query)){ ?><td><?php echo $show[id]; ?></td><?php } ?></tr>\[/code\]But as you can see this just inserts everything in one tr..Thank you
 
Back
Top