@import url('http://76tui.net/wp-content/themes/chinaf/ie.css');
欢迎来 起落博客 加入收藏 设为主页

【小实例】php输出表格 滑过行颜色



<?php
echo “<table border=1 width=80%>”;
print”<caption><h2>xxx</h2></caption>”;
$i=1;
$k=1;
while($i<=10){
   if($i%2==0){$bgc=”#006666″;}else{$bgc=”#0011ff”;}
   echo”<tr bgcolor=’$bgc’ onmouseover=’show(this);’ onmouseout=’noshow(this);’>”;
   $j=1;
   while($j<=10){
   echo”<td>”.$k++.”</td>”;
   $j++;
   }
   echo”</tr>”;
   $i++;
}
print(“</table>”);
?>
<script language=”javascript”>
  function show(obj){
  obj.style.backgroundColor=”red”;
  }
  function noshow(obj){
  obj.style.backgroundColor=””;
  }
</script>

原创文章,转载请注明:起落SEO博客
本文链接地址: http://76tui.net/archives/31.html

发表评论

Your email is never published nor shared. Required fields are marked *

*

*

=2339*

输入您的评论:


评论