jsTree is a javascript based, cross browser tree component. It is packaged as a jQuery plugin. jsTree is absolutely free (licensed same as jQuery – under both GPL and MIT – whichever suits your needs).
Take a plain html table, wrap the rows you want collapsing/expanding in a tbody with an id of treetable, map each row to the parent row, set some options, and let jQTreeTable take it from there.
tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell