JavaScript Reference/Javascript Methods/moveRow
"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> </td>
</tr>
<tr>
<td>Second Row</td>
<td> </td>
</tr>
<tr>
<td style="background-color:blue">Third Row</td>
<td> </td>
</tr>
<tr>
<td style="background-color:red">Fourth Row</td>
<td> </td>
</tr>
</table>
<button onclick="function1();">Move Row</button>
</body>
</html>
"moveRow()" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |<table> <tbody> |
| |<tfoot> <thead> |
+----------------+--------------------------------------------------------------+
"moveRow()" Syntax, Parameters and Note
Note:
Moves row to a new position.
Syntax:
document.all.elementID.moveRow(param1, param2)
Parameters:
param1 Required; the index of the row to move.
param2 Required; the index of the new position.