<!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">
       <th>北大</th><th>法律</th><th>2000</th>
       </tr>
       <tr align="center">
       <th>清华</th><th>计算机</th><th>5000</th>
       </tr>
           <tr align="center">
       <th>人大</th><th>经济</th><th>6000</th>
       </tr>
   </table>
  </body>
</html>

  JavaScript+CSS+DIV实现表格变色示例

相关文章:

  • 2021-12-04
  • 2021-12-04
  • 2021-12-12
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2021-06-17
  • 2022-12-23
猜你喜欢
  • 2021-10-12
  • 2022-12-23
  • 2022-02-08
  • 2022-01-04
  • 2022-12-23
  • 2022-01-20
  • 2022-12-23
相关资源
相似解决方案