Make table sortable

<< Click to Display Table of Contents >>

Navigation:  Using script in HTML document > Usage examples >

Make table sortable

<script type="passcript">

$('#tableid th').on('click', 'this.upto(''table'').SortColumn:=this.Col;');

</script>

 

<table id="tableid">
 <tr><th>header</th></tr>
 <tr><td>3</td></tr>
 <tr><td>2</td></tr>
 <tr><td>1</td></tr>
</table>