Refactor assign_height for block, table-*