JSFiddle - React, Tailwind, and code Playground

HTML

<div>
	<p style="background: red; height: 100px">1</p>
	<p style="background: blue; height: 140px">2</p>
	<p style="background: green; height: 90px">3</p>
	<p style="background: blue; height: 120px">4</p>
	<p style="background: red; height: 80px">5</p>
	<p style="background: brown; height: 140px">6</p>
	<p style="background: brown; height: 100px">7</p>
	<p style="background: yellow; height: 90px">8</p>
	<p style="background: pink; height: 120px">9</p>
</div>

CSS

div {
	-webkit-columns: 3;
	   -moz-columns: 3;
	        columns: 3;

	-webkit-column-gap: 2px;
	   -moz-column-gap: 2px;
	        column-gap: 2px;
}

p {display: inline-block; width: 200px; margin: 1px}