Fix sorting when the table has multiple rows of th's

Fixes #67