JSFiddle - React, Tailwind, and code Playground
HTML
<div class="wrapper1">
<div class="container1">Height: 50%</div>
<div class="container2">
<div class="table">
<div class="row">
<div class="cell1">Height: 50%</div>
<div class="cell2">Height: 50%</div>
<div class="cell3">Height: 50%</div>
</div>
</div>
</div>
</div>
<div class="wrapper1">Height: 100%</div>
<div class="wrapper1">
<div class="container1"> This one has a height of 50%</div>
<div class="container2">
<div class="table">
<div class="row">
<div class="cell1">Height: 50%</div>
<div class="cell2">Height: 50%</div>
<div class="cell3">Height: 50%</div>
</div>
</div>
</div>
</div>
<div class="wrapper1">Height: 100%</div>
CSS
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
.wrapper1 {
width: 100%;
height: 50%;
background: SkyBlue;
top: 0px;
}
.wrapper2 {
width: 100%;
height: 100%;
background: aqua;
}
.container1 {
width: 100%;
height: 50%;
background: green;
}
.container2 {
width: 100%;
height: 50%;
background: red;
}
.table {
display: table;
width: 100%;
height: 100%;
}
.row {
display: table-row;
width: 100%;
}
.cell1, .cell2, .cell3 {
display: table-cell;
width: 33%;
height: 100%;
}
.cell1 {
background: blue;
}
.cell2 {
background: red;
}
.cell3 {
background: yellow;
}