<div class="codetitle"> <span><a style="CURSOR: pointer" data="85711" class="copybut" id="copybut85711" onclick="doCopy('code85711')"><u>复制代码</u></a></span>代码如下:</div> <div class="codebody" id="code85711"> <br><html> <br> <br><title></title> <br><style type="text/css" > <br>テーブル {背景:#949494;幅:400ピクセル; line-height:20px;} <br>td { border-right:1px ソリッドグレー; border-bottom:1px ソリッドグレー; } <br></style> <br><script src="jquery.js" type="text/javascript"></script> <br><script type="text/javascript" > <br>function up(obj) { <br>var objParentTR = $(obj).parent().parent(); <br>var prevTR = objParentTR.prev(); <br>if (prevTR.length > 0) { <br>prevTR.insertAfter(objParentTR); <br>} <br>} <br>function down(obj) { <br>var objParentTR = $(obj).parent().parent(); <br>var nextTR = objParentTR.next(); <br>if (nextTR.length > 0) { <br>nextTR.insertBefore(objParentTR); <br>} <br>} <br></script> <br></head> <br> <br><table border="0" > <br><tr><td>1</td><td>12</td><td>13</td><td><a href="#" onclick="up (これ)>上移動</a> <a href="#" onclick="down(this)">下移動</a></td></tr> <br><tr><td>2</td><td>22</td><td>23</td><td><a href="#" onclick="up (これ)>上移動</a> <a href="#" onclick="down(this)">下移動</a></td></tr> <br><tr><td>3</td><td>32</td><td>33</td><td><a href="#" onclick="up (これ)>上移動</a> <a href="#" onclick="down(this)">下移動</a></td></tr> <br><tr><td>4</td><td>42</td><td>43</td><td><a href="#" onclick="up (これ)>上移動</a> <a href="#" onclick="down(this)">下移動</a></td></tr> <br><tr><td>5</td><td>52</td><td>53</td><td><a href="#" onclick="up (これ)>上移動</a> <a href="#" onclick="down(this)">下移動</a></td></tr> <br></table> <br></body> <br></html> <br> </div>