templates: add a js to sort table