title: Sort table row with jquery
body: <p>I'm trying to sort table row using jquery which has function like this:</p>
  
  <pre><code>                var items = $('#dp_content_table &gt; tbody &gt; tr').sort(function(a, b) {
                      var vA = $(a).attr('id');
                      var vB = $(b).attr('id');
  
                      var arrA = vA.split('_');
                      var arrB = vB.split('_');
  
                      return (arrA[1] &lt; arrB[1]) ? -1 : (arrA[1] &gt; arrB[1]) ? 1 : (arrA[1] == arrB[1] &amp;&amp; arrA[5] &lt; arrB[5]) ? -1 : (arrA[1] == arrB[1] &amp;&amp; arrA[5] &gt; arrB[5]) ? 1 : 0;
                  });
  
                      $('#dp_content_table &gt; tbody &gt; tr').append(items);
  </code></pre>
  
  <p>Basically, I'm using ID as attribute for sorting. The attribute contain day &amp; time. attr[1] is day, and attr[5] is time. If day in row A is less than B, then no need for comparing the time, and return result, on the other hand, if days are same, then compare the second attribute which is the time, and so on.</p>
  
  <p>But, so far I have no luck in sorting them. My table seems doesn't take effect at all.</p>
  
  <p>Thanks before.</p>