title: Possible to split flex columns into exactly 2?
body: <p>I have a series of images that are written to the page with the following code.</p>
  
  <pre><code>&lt;div class="gallery"&gt;
      &lt;div&gt;&lt;img src="img1.jpg"&gt;stuff here&lt;/div&gt;
      &lt;div&gt;&lt;img src="img2.jpg"&gt;stuff here&lt;/div&gt;
      &lt;div&gt;&lt;img src="img3.jpg"&gt;stuff here&lt;/div&gt;
      ....
  &lt;/div&gt;
  </code></pre>
  
  <p>Our design team want these images laid out in two columns. the number of images is variable, as is the height of each image.  The layout they have requested is something similar to below. The idea is that each column is relatively equal in height - obviously won't be exact.</p>
  
  <pre><code>+------+  +------+
  |      |  |      |
  |      |  |      |
  +------+  |      |
  +------+  |      |
  |      |  +------+
  |      |  +------+
  |      |  |      |
  |      |  |      |
  |      |  +------+
  |      |  +------+
  +------+  |      |
  +------+  |      |
  |      |  |      |
  ~~~~~~~~  ~~~~~~~~
   undefined height
  </code></pre>
  
  <p>CSS Flex nearly lays the images out as we need, but I cannot work out how to tell flex where to wrap the image list onto the second column. I cannot set the height of the container as individual image heights are variable. The amount of images will change over time although I can use PHP to calculate the number of images before the page is rendered.</p>
  
  <p>An additional hurdle, is the layout is for mobile devices, but is different for larger screens (3 columns for tablet, 4 columns for desktop etc). so I can't just use 2 divs for columns. It has to be fluid.</p>
  
  <p>What is the best way to achieve this? Is Flex even the right tool?</p>
  
  <p>my code so far works, but I have manually set a height</p>
  
  <pre><code>&lt;div class="gallery"&gt;
      &lt;div&gt;&lt;img src="img1.jpg"&gt;stuff here&lt;/div&gt;
      &lt;div&gt;&lt;img src="img2.jpg"&gt;stuff here&lt;/div&gt;
      &lt;div&gt;&lt;img src="img3.jpg"&gt;stuff here&lt;/div&gt;
      &lt;div&gt;&lt;img src="img4.jpg"&gt;stuff here&lt;/div&gt;
      &lt;div&gt;&lt;img src="img5.jpg"&gt;stuff here&lt;/div&gt;
      &lt;div&gt;&lt;img src="img6.jpg"&gt;stuff here&lt;/div&gt;
      &lt;div&gt;&lt;img src="img7.jpg"&gt;stuff here&lt;/div&gt;
      &lt;div&gt;&lt;img src="img8.jpg"&gt;stuff here&lt;/div&gt;
      &lt;div&gt;&lt;img src="img9.jpg"&gt;stuff here&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;style&gt;
     .gallery {
          display: flex;
          flex-direction: column;
          align-items: start;
          height: 1200px;
          flex-wrap: wrap;
      }
  
      .gallery &gt; div {
          width: 50%;
          padding: 15px;
          text-align: right;
          position: relative;
      }
  
      img { 
          width: 100%;
          height: auto;
      }
  &lt;/style&gt;
  </code></pre>