Sort HTML table with vanilla JavaScript

preview_player
Показать описание
Shows how to sort an HTML table using only HTML and JavaScript

Рекомендации по теме
Комментарии
Автор

thnx a lot, though for any1 who needs to get the rows by classname instead of calling the table rows, make sure u start with index 0 in the rows loop

I thought table.rows would be zero-indexed too and it looks like it is as u seem to be working zero-indexed by the looks of the second part of the for loop, maybe I´m just tired :)

Mikael_Puusaari
Автор

What if I'm trying to sort numeric? Can anyone help? :)

kevinanger
Автор

For some reason it's not working for me, in console log I dont't see index, so when i click nothing happends

milicamilivojevic
Автор

I had to start the for loop of the sortFunction with 0, so it would work correctly. But no its perfeclty fine.

mathiasflorakis
Автор

tengkiuuu
tengkiu
tengkiu
tengkiuuu!!~!!!

bamenartstudio
visit shbcf.ru