ordering column that contain numbers
ordering column that contain numbers

I have a table created from sql table, and i know if the column contains number or not.
Whic is the solution ?
I'm desperate !!!!!!!
This discussion has been closed.
I have a table created from sql table, and i know if the column contains number or not.
Whic is the solution ?
I'm desperate !!!!!!!
Answers
Hi @mori_italy ,
If they're all numbers, DataTables should treat the column as numeric and apply the sorts accordingly. If that's not happening, it suggests there is also non-numeric data in that table.
If you believe there isn't, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
in my table there are columns with string AND with numbers.
Can i put, in html, some class to advice datatables that the TD contain numbers ?
If you have text data and numeric data in the same column how do you want the ordering to work? If you have both Datatables is going to treat the column as string data. However using orthogonal data you can affect how the sorting works. Depends on your specific data and how you want it handled. Maybe you can provide a simple test case with examples of your intermixed string and numeric data.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin