嗯,如题所示,就是小时候的九九乘法表,用php+html实现的,其实就是两个for循环,本身没什么技术含量,但是耐不住有回忆杀啊。不说了,上代码!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>九九乘法表</title>
</head>
<body>
<table>
<?php for($t=1;$t<10;$t++){?>
<tr>
<?php for($n=1;$n<=$t;$n++){?>
<td style="border:1px solid #999;width:5rem;height: 2.5rem;margin: 0.1rem;text-align: center;">
<?php echo $n.'*'.$t.'='.$t*$n;?>
</td>
<?php } ?>
</tr>
<?php } ?>
</table>
</body>
</html>
效果图如下: