All the script needs is to add an attribute to the table:
<table class="sortable scroll">
and import tablesort.js file into the html code of the report.
If it's possible, where do I put declaration of external .js file how to
make additional table attributes?