I've a table displaying table with static data and trying to sort using jquery.
Code:
jQuery(document).ready(function() {
jQuery('#sortTable').dataTable( {
"order": [[ 2, "asc" ]]
});
});
HMTL:
<table class="table" id="sortTable" data-page-length="25">
<thead>
<tr><th><b>name</b></th><th><b>number</b></th><th><b>Date</b></th></tr>
</thead>
<tr><td>a</td><td>10.1</td> <td>12/31/2015</td></tr>
<tr><td>d</td><td>1.1</td> <td>12/1/2015</td></tr>
<tr><td>a</td><td>2.3</td> <td>12/2/2015</td></tr>
<tr><td>e</td><td>1.7</td> <td>12/3/2015</td></tr>
<tr><td>f</td><td>9.1</td> <td>12/31/2016</td></tr>
</table>
When I click on the number to sort, the sorting is not right as it is treating number as a String, is there anyway that I can resolve this issue...