- 时间:2022-08-06 00:05 编辑: 来源: 阅读:
- 扫一扫,手机访问
摘要:用表格输出1-1000之间的数字实现代码(附特效)
<html>
<head>
<title>
</title>
<script>
var cc= null;
function show(obj)
{
cc=obj.style.backgroundColor;
obj.style.backgroundColor="Red";
}
function disshow(obj)
{
obj.style.backgroundColor=cc;
}
</script>
</head>
<body>
<?php
echo "<table border=1 align=center width=800";
echo "<caption><h1>用表格输出1-1000之间的数字</h1></caption>";
$i=0;
$k=1;
while($i<100)
{
$i++;
if($i%2==0)
$bgc="#ccba6e";
else
$bgc="#eefa43";
echo "<tr bgcolor='".$bgc."'onmouseover='show(this)'
onmouseout='disshow(this)' >";
$j=0;
while($j<10)
{
echo "<td>".$k."</td>";
$j++;
$k++;
}
echo "</tr>";
}
echo "</table>";
?>
</body>
</html>
[img]http://files.jb51.net/file_images/article/201304/2013421151146638.jpg?201332115146[/img]