tristen / tablesort

:arrow_up_down: A small tablesorter in plain JavaScript
https://tristen.ca/tablesort/demo/
MIT License
1.1k stars 179 forks source link

2 tables on the page. Mobile version does not work #193

Closed savisky closed 4 years ago

savisky commented 4 years ago

I have two tables on the page. One is for the mobile version and it's hidden from the desktop version. 1) Does Tablesort work for mobile? 2) If yes how to add that second table and make it work?

Thanks

tripu commented 4 years ago

Off the top of my head, I don't think Tablesort would behave necessarily differently on a mobile browser than on desktop.

Are you sure the problems you found are not related to that second table being hidden? Have you tried reproducing the error on desktop — ie, having that second hidden table also on desktop and checking if it behaves differently or not?

In principle, you could have any number of tables, like so:

<table id="first"> ⋯ </table>
<table id="second"> ⋯ </table>
<table id="third"> ⋯ </table>
new Tablesort(document.getElementById('first'));
new Tablesort(document.getElementById('second'));
new Tablesort(document.getElementById('third'));

Finally, please provide a working example (paste sources, or share on Codepen or similar site).

savisky commented 4 years ago

Thanks, mate I already did and everything works like a charm. So you can see the live version here: https://www.perfumetr.com/perfume/1-million/

Thanks