fixed sorting of tables

and sorting links in visit