title: Rearrage html table column in jquery
body: <p>HTML table        </p>
  
  <pre><code>&lt;thead&gt;
      &lt;tr&gt;
        &lt;th class="text-center"&gt;1&lt;/th&gt;
        &lt;th class="text-center"&gt;3&lt;/th&gt;
        &lt;th class="text-center"&gt;2&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  
  &lt;tbody class="result_body"&gt;
  
  &lt;/tbody&gt;
  </code></pre>
  
  <p>data</p>
  
  <pre><code>var data = [
                 {
                    "0": "1",
                    "1": "20"
                 },                  
                 {
                    "0": "2",
                    "1": "30"
                 },
                 {
                    "0": "3",
                    "1": "5"
                 }
               ]
  </code></pre>
  
  <p>I create one table with th name 1,3,2, after that inside jquery I try to loop the data and append into the table. But it will follow the sequence with is 1,2,3. How can I append the data follow the table sequence with is 1,3,2?</p>
  
  <p>Jquery Data output</p>
  
  <pre><code>&lt;th&gt;
    &lt;td&gt;20&lt;/td&gt;
    &lt;td&gt;30&lt;/td&gt;
    &lt;td&gt;5&lt;/td&gt;
  &lt;th&gt;
  </code></pre>
  
  <p>Data correct should be</p>
  
  <pre><code>&lt;th&gt;
    &lt;td&gt;20&lt;/td&gt;
    &lt;td&gt;5&lt;/td&gt;
    &lt;td&gt;30&lt;/td&gt;
  &lt;th&gt;
  </code></pre>
  
  <p><strong><em>code here</em></strong>
  <a href="https://jsfiddle.net/vwL0frhm/1/" rel="nofollow noreferrer">https://jsfiddle.net/vwL0frhm/1/</a></p>