table: improve automatic mode