Table will not sort sequentially
-
Hello!
I’m trying to set up a table ranking the best state for female entrepreneurs. I am using DataTables to enable sorting of columns, and by default everything is sorted with the first column numbered 1-50. However, if I sort by another column and then try to get the first column to sort 1-50 again, it doesn’t work properly. Instead of going 1, 2, 3… it sorts by 1, 10, 11, 12, 13… until it finishes the teens and then hits 2, 20, 21, 22… and so forth.
I found this bit of code on another thread saying I could tweak it in the “Custom Commands” field, but I’m unsure of how to do so to make the table do what I want: “columnDefs”: [ { “type”: “formatted-num”, “targets”: [ 0 ] } ]
Other tables work properly if I have the number separated out into its own column (as seen on https://fitsmallbusiness.com/best-states-to-start-a-business/) but I would really love to not have to do that. Can you please lend a hand?
Thanks in advance!!
The page I need help with: [log in to see the link]
The topic ‘Table will not sort sequentially’ is closed to new replies.