Mega Code Archive

 
Categories / JavaScript Reference / Javascript Methods
 

MoveRow() Example

<html> <body> <script language="JavaScript"> function function1() {    document.all.myTable.moveRow(-1, 2); } </script> <table id="myTable" border="1" cellspacing="5" cellpadding="5">     <tr>         <td>First Row</td>         <td>&nbsp;</td>     </tr>     <tr>         <td>Second Row</td>         <td>&nbsp;</td>     </tr>     <tr>         <td style="background-color:blue">Third Row</td>         <td>&nbsp;</td>     </tr>     <tr>         <td style="background-color:red">Fourth Row</td>         <td>&nbsp;</td>     </tr> </table> <button onclick="function1();">Move Row</button> </body> </html>