You could have:
<th>
<a href="/search?sort=name&direction=asc"> Name <a>
The server side code would interpret the sort and direction parameters and sort results as instructed.
You could have:
<th>
</th>The server side code would interpret the sort and direction parameters and sort results as instructed.