How to move the rows of the table in java script based on the data
<p>I am new to javascript/jquery.
I apologize if my question is very basic.
I have a table in java script with headers like</p>

<pre><code>Element price gain
 xyz     10   20
 abc     29   10
</code></pre>

<p>the value of the gain is coming from the back and it is keep on changing the value.
Now my question is when ever the value changes then the table should automatically sorted.
The rows of the table should move automatically
Lets say in the above example the gain for the abc is "30" which came from the back end then 
the table should change automatically
.The table should look like this now</p>

<pre><code>Element price gain
abc      29   30
xyz      10   20
</code></pre>

<p>So here the rows shuffled based on the data.
How can we achieve this thing in javascript /jquery</p>

<p>I would really appreciate if some one can give any ides how to do.</p>

<p>Thanks,
Swati</p>
