parsing and setting classes on td-values