moveRow Method

DHTML, HTML, & CSS

 
Click to return to the DHTML, HTML & CSS home page    
moveEnd Method     moveStart Method     DHTML Methods    

moveRow Method

Moves a TABLE row to a new position.

Syntax

oRow = object.moveRow(iSource, iTarget)

Parameters

iSource Required. Integer that specifies the index in the rows collection of the table row that is moved.
iTarget Required. Integer that specifies where the row is moved within the rows collection.

Return Value

Object. Returns a reference to the table row that is moved.

Remarks

Rows between the iSource and iTarget positions in the rows collection are shifted based on the direction the row moves.

Example

This example uses the moveRow method to exchange the first and second rows in a table when the user clicks a button.

Sample Code

<SCRIPT>
function fnMove(){
   oTable.moveRow(0,1);
}
</SCRIPT>
<INPUT TYPE="button" VALUE="Change Rows" onclick="fnMove()">
<TABLE ID="oTable">
<TR><TD>Cell 1, Row 1</TD></TR>
<TR><TD>Cell 1, Row 2</TD></TR>
</TABLE>

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
TABLE, TBODY, TFOOT, THEAD

Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.