Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is… not obvious. It's only easy if you want the simplistic approach of sorting lexicographically or numerically. But in more complex tables, you will often encounter cases where the data representation for sorting is different from data representation for display.

Of course most JavaScript-based tables get this wrong, too.



You could have a `sortkey` attribute, a bit like <option> that has a `value` attribute in case the value you want is different from the value you display.


Even then how does it interact with rowspans and colspans...




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: