简体   繁体   中英

JavaScript Table Sorting accented characters with sorttable

I'm trying to make a sortable HTML table with Sorttable Which's code is here

And it works just fine but I have some words with accented first characters (especially Á) in the <td> s and it just throws them after the Z.

I tried some ideas but I'm a beginner at Javascript and I couldn't make it work.

So please help me: How can I make some changes in the code to sort the accented characters correctly?

You need to use the sortLocaleCompare property to true :

$("#myTable").tablesorter({
    sortLocaleCompare : true
});

More Information

Maybe this could help? jQuery Plugin: Tablesorter

You may have to modify it slightly if the special character you are using is not supported but it should at least get you started.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM