Removed code that tried to handle thead/tbody weirdness, turns out it was not really necessary and besides, tables should be reasonably well formed