I know Stack Overflow isn’t there to solve my problems, but to ask specific questions.
But I need to implement a sort function for a html table and have no idea how to do it.
The user should be able to click on the column header and the table should then be sorted by that column.
The table looks like this:

There are several plug-ins available works with jQuery. Try this one http://tablesorter.com
Add this library to your page like
<script type="text/javascript" src="<your-path>/jquery.tablesorter.js"></script>apply the class called
tablesorterto your table and say$(".tablesorter").tablesorter();