search for th only in thead

th could also be in tfooter, so we need to search them only in thead