javascript & php 做的乘法表例子比较
引用请注明出处: https://seonoco.com/blog/1174
发布于 分类 Html5
602天前 有1个用户阅读过
本文来自我的百度空间博客详情
2007年开始使用的是 hi.baidu.com/udjy
后来百度空间强制升级为轻博客 hi.baidu.com/imnoco
2015年百度关闭了百度空间
<script type="text/javascript">
document.write("<table>");
for(i=1; i<7; i++)
{
document.write("<tr>");
for(j=1; j<7; j++)
{
var c = i*j;
document.write("<td style='width:100px; background:#ddd; border:2px solid
#090; padding:5px;'>" + i +" *" + j +" =" + c +"</td>");
}
document.write("</tr>");
}
document.write("</table>");
</script>
-----------------------------------------------------------------------------------------------
<html>
<head>
<style type="text/css">
body td{
width:100px;
border:2px solid #090;
padding:5px;
background:#ddd;
}
</style>
</head>
<body>
<?php
echo"<table>\n";
for($i=1; $i<7 ;$i++)
{
echo"<tr>\n";
for($j=1; $j<7; $j++)
{
echo"<td>";
$z = $i * $j;
echo"$i * $j = $z";
echo"</td>";
}
echo"\n</tr>\n";
}
echo"\n</table>\n";
?>
</body>
</html>
-- The End --