PHP输出排序想排成一行5列,一共11行
<TBODY>
<?php
$all_book=$sql->mdenin_select("SELECT * FROM `banner_news` WHERE `news_fenlei` ='$v1' LIMIT 0 , 1200");
foreach ((array)$all_book as $IDwuliu) {
?>
<TR>
<TD width="20%"><A href="http://www.lwfree.com/" ><?=$IDwuliu['key'];?></A></TD>
<TR>
<?php }?>
</TBODY></TABLE>
数据一共52条,我想排成一行5列,一共11行。怎么做到
for($i=0;$i<5;$i++){
echo "<tr>";
for($j=0;$j<11;$j++){
$c=$i*$j;
echo "<td>$array[$c]</td>";
}
echo "</tr>";
}