<?php
?>
<style>
.diva {width:300px;}
.diva div {width:100px; float:left;}
</style><div class="diva">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
</div>
/*
$count :循环次数
$sum:一行输出多少个换行
*/
echo_table(20,3);
function echo_table($count,$sum)
{
echo '<table><tr>';
for($i=1;$i<$count;$i++)
{
echo '<td>'.$i.'</td>';
if($i%$sum==0)
{
echo '</tr><tr>';
}
}
echo '</table>';
}