Change Drop Down Row Sequence Number

I have a need to change the display sequence of rows in an editable grid. In other words I would like to have a list box and if I want to change the order of the rows, I need it to traverse through the entire grid.

Example:
If I input the following rows: [TABLE=“border: 1, cellpadding: 1”]
[TR]
[TD]ID[/TD]
[TD]Description[/TD]
[TD]Priority (this will be a list box)[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Test 1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Test 2[/TD]
[TD]2[/TD]
[/TR]
[/TABLE]

Now lets say I add a row [TABLE=“border: 1, cellpadding: 1, width: 500”]
[TR]
[TD]ID[/TD]
[TD]Description[/TD]
[TD]Priority (this will be a listbox)[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Test 1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Test 2[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Test 3[/TD]
[TD]3[/TD]
[/TR]
[/TABLE]

I want to change the priority so they display in that order but I want to be able to auto adjust the other rows [TABLE=“border: 1, cellpadding: 1”]
[TR]
[TD]ID[/TD]
[TD]Description[/TD]
[TD]Priority (this will be the listbox)[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Test 3[/TD]
[TD]1 (when I change this to Priority 1 ID 1 changes Priority to 2 and ID 2 Change to Priority 3 automatically)[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Test 1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Test 2[/TD]
[TD]3[/TD]
[/TR]
[/TABLE]

Any idea how to do this in SC?