Numeric data Sorting Does not work as expected with html tag

Numeric data Sorting Does not work as expected with html tag

FelixPereraFelixPerera Posts: 1Questions: 0Answers: 0
edited May 2012 in General
Hi ,
I have tried v 1.9.1 with a simple table, which consist 1 character column and 2 numeric colums.
e.g. Singapore 5 3
Malaysia 4 40
China 90 2
It is working perfectly as above. But when I add html tag to column 2, I cannot sort column 2 in numeric order. it will list 40, 5, 9. Instead 40, 9, 5. How to resolve this issue.


[Code]



Singapore
5
3


Malaysia
40
32


China
9
2



[/code]

Replies

  • allanallan Posts: 63,237Questions: 1Answers: 10,418 Site admin
    There is a plug-in for that sorting type: http://datatables.net/plug-ins/sorting#numbers_html :-). There is also a type detection plug-in to make things easier.

    Allan
This discussion has been closed.