数组-实现表格状打印

代码 如下 这个有点繁琐,需要逻辑的数学知识。

<?php

$a=array(array());?>
<table width="10" height="5" border="1" align="center" cellpadding="2" cellspacing="1">
<?php
for($i=0;$i<12;$i++)

{?>
<tr>
<?php
for($j=0;$j<12;$j++){
?>
<td width="10" height="10">
<?php $a[$i][$j]=($i+1)*($j+1); //主要代码
echo $a[$i][$j];?>
</td>
<?php
}
?>
</tr>
<?php
}
?>
</table>

相关文章: