I am using DataTables plugin version 1.10.13. In my table, column at index 5 contains a Bootstrap progress bar, and the resulting HTML looks somewhat like this:
<td>
<div class="progress"
style="margin-bottom:0px;"
title="10% Complete"
data-placement="top"
data-toggle="popover"
data-trigger="hover"
data-html="true"
data-content="
Some data here...
"
>
<div class="progress-bar " role="progressbar" aria-valuenow="10"
aria-valuemin="0" aria-valuemax="100" style="width: 10%;">
<span class="sr-only">10</span>
</div>
</div>
</td>
Now, without any options, DataTables sorts this columns alphabetically, so records with the progress bar of 90 are at the very top, while the one with 100, 10, and finally 0 are at the bottom. The problem is that 100 is supposed to be at the very top.
I tried html-num, html-num-fmt, num, and a handful of others, but they either don't work or sort alphabetically. Basically, the goal here is to sort numerically, and not alphabetically. I also tried displaying the value (e.g. 10 or 100) inside the <td> itself, but it didn't change anything. At this point, I am not even sure how DataTables reads the HTML markup. Does it look at the <span> with the class of sr-only?
Can someone suggest a solution?
EDIT
@Gyrocode.com created a great jsfiddle. I added more records to show the problem: jsfiddle
Progress<th>. I do appreciate the fiddle though, thanks!num-htmlbut again it works for me without plugins.90but width of10%which looked as result of a wrong sort operation. Here is how column appear for me in jsfiddle.net/k4aauf0n/2, it's sorted correctly from 10,30,90,90 to 100, see i.sstatic.net/9WsLb.png