zoukankan      html  css  js  c++  java
  • JavaScript+CSS+DIV实现表格变色示例

    <!DOCTYPE html>
    <html>
      <head>
        <title>colortable.html</title>
      <script language="javaScript">
          function changecolor(row){
             document.getElementById(row).style.backgroundColor='#CCCCFF';
             
          }
          function resetcolor(row){
             document.getElementById(row).style.backgroundColor='';
             
          }
      </script>
      </head>
      
      <body>
       <table width="200"border="1"cellspacing="1"cellpadding="1"align="center">
           <tr><th>学校</th><th>专业</th><th>人数</th></tr>
           <tr align="center"id="row1"onMouseOver="changecolor('row1')"onMouseOut="resetcolor('row1')">
           <th>北大</th><th>法律</th><th>2000</th>
           </tr>
           <tr align="center"id="row2"onMouseOver="changecolor('row2')"onMouseOut="resetcolor('row2')">
           <th>清华</th><th>计算机</th><th>5000</th>
           </tr>
               <tr align="center"id="row3"onMouseOver="changecolor('row3')"onMouseOut="resetcolor('row3')">
           <th>人大</th><th>经济</th><th>6000</th>
           </tr>
       </table>
      </body>
    </html>
    

      

    时间最会骗人,但也能让你明白,这个世界上没有什么是不能失去的,留下的尽力珍惜,得不到的都不重要
  • 相关阅读:
    获取deeplearning电子书
    iterm2 粘贴时有多余字符 0~ 1~
    linux mint使用中的问题解决记录
    column命令
    命令行中画图
    sphinx转pdf显示中文
    linux查看显卡
    python 3.6
    Mac笔记本中使用postgresql
    计算KS值的标准代码
  • 原文地址:https://www.cnblogs.com/www-x/p/7736344.html
Copyright © 2011-2022 走看看