added support for tbody and thead. consider rows inside thead to be headers regardless of td/th tags