I needed a simple scrolling, sorting table for a project, and the available grid controls (e.g.: jqGrid, flexigrid) were really too heavy for my limited needs. I didn’t need inline editing, grouping, or any of the other advanced features these grids provide. Christian Bach’s tablesorter plugin (www.tablesorter.com) was a great alternative, but my project required the table fit in a window of limited height. I needed a way to add scrolling to tablesorter.
Fortunately, tablesorter’s ‘widget’ architecture makes it easy to add functionality as it is needed. This widget duplicates the table header and wraps the original table in a scrolling div. It then hides the original table’s header. Header cell clicks are trapped and passed to the original table via tablesorter’s ‘sorton’ event.