Arrange elements in a multidimensional grid by sortable properties