Due to the image tag, it is sorted as a string. It will start sorting with the first text that it sees, so the way I get around this is to add a hidden range with a numeric value. You just have to remember to make all the values ββthe same length, since they will still be sorted as strings. You can do this by adding 0.
Example [assuming that I know that my number will never be more than 100]:
<td><span style="display:none">024</span><img src='edit.png'>24</td> ... <td><span style="display:none">001</span><img src='edit.png'>1</td> ... <td><span style="display:none">033</span><img src='edit.png'>33</td> ... <td><span style="display:none">051</span><img src='edit.png'>51</td>
Upward sorting, even as a string, will result in 1, 24, 33, 51
scottysmalls
source share