JSFiddle - React, Tailwind, and code Playground

HTML

<div class="flex-container">
    <div class="flex-item">1</div>
    <div class="flex-item">2</div>
    <div class="flex-item">3</div>
    <div class="flex-item">4</div>
    <div class="flex-item">5</div>
    <div class="flex-item"></div>
    <div class="flex-item"></div>
</div>

CSS

.flex-container {
    align-content: space-between;
    align-items: flex-start;
    display: flex;
    flex-flow: row wrap;    
    justify-content: space-between;
    
}
.flex-item {
  background: tomato;
  width: 31%;
  height: 150px;  
  line-height: 150px;
  color: white;
  font-weight: bold;
  font-size: 3em;
  text-align: center;
}
.flex-item:not(:nth-of-type(-1n + 3)) {
  margin-top: 3.5vw;
}
.flex-item:empty {
    visibility: hidden;
    height: 0;
    margin: 0;
}