9.27 交换表的行.htm

来自「一些javascript的小例子希望对初学者有更好的帮助」· HTM 代码 · 共 25 行

HTM
25
字号
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>标题页</title>
    <script language="javascript">
     function changerow()
    {
       document.getElementById("mytbl").moveRow(1,0);
    }
    </script>
</head>
<body>
<input id="Button1" type="button" value="交换行" onclick="changerow()" />
<table id="mytbl" width="300" height="50" border="0" cellspacing="2" cellpadding="0" bgcolor="#FFb609">
  <tr> 
    <td> 第一行第一列</td><td> 第一行第二列</td>
  </tr>
  <tr> 
    <td> 第二行第一列</td><td> 第二行第二列</td>
  </tr>
</table>
</div>
    
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?