Hi,
thanks for your post, and sorry for the trouble.
That is expected. Due to the extra letters, the column is treated like a string and not as a number anymore.
One idea to fix this should be to use the TablePress Extension from https://tablepress.org/extensions/datatables-sorting-plugins/ and then instruct the library to sort the column as a “formatted number”.
Regards,
Tobias
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!
Thread Starter
hrndgn
(@hrndgn)
again hi,
adress :http://www.iyikibakmisim.com/ornek-tablo/
e.g.
seventh column “cam2”
custom command :”columnDefs”: [ { “type”: “formatted-num”, “targets”: [ 2, 3, 4, 5, 6, 7, 8 ] } ]
<h2 style=”text-align: center;”>16mp</h2>
so that I can not sort————————
but custom command :”columnDefs”: [ { “type”: “formatted-num”, “targets”: [ 2, 3, 4, 5, 7, 8 ] } ]
this time doing the wrong sorting As in the sixth column “cam1”
Hi,
thanks for your post, and sorry for the trouble.
The reason for this basically is that the code that you have added there (<h2>) also contains numbers.
I therefore suggest to not use extra HTML code in the table cells, but to style the content with CSS code. That way, you have simple numbers in the cells and the “Custom Commands” should work.
Regards,
Tobias