JSFiddle - React, Tailwind, and code Playground
HTML
<div id="app">
<div>
<div>1</div>
</div>
<div>
<div>
2
</div>
<div>
4
</div>
</div>
<div>
<div>
3
</div>
<div>
5
</div>
</div>
</div>
SASS
#app
display: flex
justify-content: stretch
> div
margin: 0 0.5rem
background-color: salmon
flex-grow: 1
display: flex
flex-direction: column
&:first-child
margin-left: 0
&:last-child
margin-right: 0
> div
min-height: 3rem
margin: 0.5rem 0
background-color: beige
flex-grow: 1
display: flex
align-items: center
justify-content: center
&:first-child
margin-top: 0
&:last-child
margin-bottom: 0