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

Trim contents for default comparison #146

Closed kausters closed 6 years ago

kausters commented 7 years ago

This fixes an issue where the basic comparison could be wrong if table cells have varying amounts of whitespace before/after the actual content, as generated HTML tends to have.

> "a" < "b"
→ true

> " a " < "  b  "
→ false