Pure CSS Solution
Here is a DEMO of this solution.
In this DEMO, you see multipple Row s, each Row can have a variable number of columns, without specifying anything in the markup and not fixing any width. (the width is always evenly distributed between the columns). Each column is called ElementsHolder and can contain any number of Elements .
the entire column in the row will always have the same height, and the last arrow in the row will fill this space.
In DEMO you can see 3 Row s. The first Row has a starting point, so there is no need to stretch. The second Row has 3 ElementsHolder , without indicating anything special in the layout, 2 of them will stretch to fill the gap. The third Row has 2 ElementsHolder , behaves as expected.
note that stretching works regardless of Element height. (some of them have 2 or 3 lines of text, and it works great)
If you want to use this technique, you only need to implement other types and arrows (curve, etc.).
The solution is implemented using the new Flex flex model. the direction is set via flex-direction: row; Each row has an ElementsHolder that gets equal width.
each of these ElementsHolder also a flexible box, but this time its direction is opposite ( flex-direction: column; ).
the child of ElementsHolder is equal to Element & Arrow s, I don't want them to be of equal height, but to fix the natural height. except for the last arrow, which should cover the rest of the container.
all this is achieved using the flex property with the appropriate values.
More details on the flex model can be found HERE