Arrange an array aligned in columns vertically or horizontally.