How to sort a table knowing row position?
<p>I have a table:</p>

<pre><code>&lt;table&gt;
    &lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>An array that tells where every row should come <code>[{index: 2},{index: 1},{index: 0}]</code> (first row is the last from the array, second row is the <code>1</code> in array and third row <code>0</code> from the array).</p>
