msdn1 2006-5-14 14:10
怎么让两个TR可以颠倒位置
我想用button控制TR的位置,可以调整几个TR互相调换位置!!怎么实现??
迦楼罗 2006-5-14 14:11
<table border="1" width="100" id=s>
<tr>
<td width="50%">1</td>
<td width="50%">2</td>
</tr>
<tr>
<td width="50%">3</td>
<td width="50%">5</td>
</tr>
<tr>
<td width="50%">6</td>
<td width="50%">7</td>
</tr>
</table>
<input type="button" value="Down" onclick="s.insertRow(0).replaceNode(s.rows[s.rows.length-1])">
<input type="button" value=" Up "onclick="s.insertRow(s.rows.length).replaceNode(s.rows[0])">
MaxFree 2006-5-14 14:11
<table>
<tr><td>
<table id="tb1" border=1>
<tr><td>aaa</td></tr>
<tr><td>aaa</td></tr>
</table>
</td></tr>
<tr><td>
<table id="tb2" border=1>
<tr><td>bbb</td></tr>
<tr><td>bbb</td></tr>
</table>
</td></tr>
</table>
<INPUT TYPE = button VALUE = "Swap List" onclick = "fnSwap()">
<SCRIPT>
function fnSwap(){
tb1.swapNode(tb2);
}
</SCRIPT>