PHP输出排序
<TABLE id=tab_s cellSpacing=1 cellPadding=0 width="100%" border=0>
<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.xunlei.com/"><?=$IDwuliu['key'];?></A></TD>
<TR>
<?php }?>
</TBODY></TABLE>
数据一共52条,我想排成一行5列,一共11行。怎么做到。
------解决方案--------------------
PHP code
for($i=0;$i<5;$i++){
echo "<tr>";
for($j=0;$j<11;$j++){
$c=$i*$j;
echo "<td>$array[$c]</td>";
}
echo "</tr>";
}