Setting up a self updating leaderboard for me and my friends, I opted to use a scraper+cronjob to feed .csv to an updating html table using this project.
https://github.com/derekeder/csv-to-html-table
I want to combine two columns data with their respective data to be more useful when sorted from ascending to decreasing.
Example input.csv
Name,Rank,LP,Wins,Losses,Winratio
name1,Gold 5,10 LP,7W,5L,Win Ratio 58%
name2,Platinum 1,100 LP,15W,13L,Win Ratio 54%
name3,Platinum 3,44 LP,9W,6L,Win Ratio 60%
name4,Diamond 3,41 LP,148W,147L,Win Ratio 50%
name5,Master,79 LP,121W,97L,Win Ratio 56%
Example output:Output
Now, what I'm looking to do is make the "Rank", "Wins" and "Losses" columns to sort by highest
These are the ranks Highest to Lowest, I don't think I can just match the exact name specifically since everything below Diamond gets separated into five separate sub categories by adding a number behind the rank, the only exclusions to this are Master and Challenger.
Trying this code didn't seem to do the job previously
case 'Challenger': return 1;
case 'Master': return 2;
case 'Diamond': return 3;
case 'Platinum': return 4;
case 'Gold': return 5;
case 'Silver': return 6;
case 'Bronze': return 7;
I was able to find documentation to resolve an issue similar to mine on the datatables website but I'm not proficient enough in jQuery to adapt it to my situation. https://www.datatables.net/examples/plug-ins/sorting_manual.html
enumplugin - should do what you need.