fixes #8571 completely: add better th support for table classes