title: Better aproach for sorting numerical and text string?
body: <p>I have a table with column names inside <code>&lt;th&gt;</code> and only numbers inside <code>&lt;td&gt;</code>.
  When I click on the <code>&lt;th&gt;</code> the sorting algoritm sorts values asc or desc.</p>
  <pre><code>.sortElements(function (a, b) {
      return $.text([a]) &gt; $.text([b]) ?
            inverse ? -1 : 1
            : inverse ? 1 : -1;
  }
  </code></pre>
  <p>This sorts the text but there is the eternal <code>string vs number</code> problem. This sorts as string so 10 is smaller than 2 so I did this</p>
  <pre><code>.sortElements(function (a, b) {
      return parseInt($.text([a]),10) &gt; parseInt($.text([b]),10) ?
            inverse ? -1 : 1
            : inverse ? 1 : -1;
  }
  </code></pre>
  <p>This is sorting in the correct way (correct for my needs) if you have only numbers and 10 is bigger than 2.
  Now I ask you... Is there a better way to do this?</p>
  <p>What about if you have also letters inside <code>&lt;td&gt;</code>? What must be done? This is for someone who needs this to work correctly no matter what is inside <code>&lt;td&gt;</code>...?</p>