I have had great success with DataTables (another jQuery plugin) with similar line numbers, what are you talking about. The loss of speed that you see with javascript over what you saw in java is actually a DOM rendering that works a lot more. The beauty of DataTables is that you have the ability to generate data from a javascript array (essentially json) - so sorting is done by array (at the same speed as java), and then only the part of the table that the user should see is generated in the DOM.
See these URLs for examples:
http://datatables.net/examples/data_sources/js_array.html
or
http://datatables.net/examples/data_sources/ajax.html
I suggest using the latter. If its still not fast enough using a static json array, you will want to build a serveride script to take the load off javascript - a great example with server code here:
http://datatables.net/examples/data_sources/server_side.html
Edit: Infinite Scrolling
As discussed in the comments, the problem is not in sorting, but rather in converting the HTML table to JS and vice versa. This can only help by loading the rendering parts of the return type when the user views it; the server also provides JS with the same information as the table in JSON form. These two methods eliminate the problems of converting and rendering HTML-JS and thereby significantly increase the speed.
HTML (this is all that should be rendered initially before the appearance of JSON - add as many tons of tags as you have):
<table id="table_id"> <thead> <tr> <th>Column 1</th> <th>Column 2</th> <th>etc</th> </tr> </thead> <tbody> </tbody> </table>
Jquery:
$(document).ready(function() { $('#table_id').dataTable( { "bScrollInfinite": true, "bScrollCollapse": true, "sScrollY": "200px", "bProcessing": true, "sAjaxSource": 'array.txt' }); });
array.txt contains:
{ "aaData": [ ["This will be in column 1","This in two","this in 3"], ["another row - column 1","another two","another 3"] ]}