Expected output : 2 rows and multiple columns
Output I got : multiple rows and 1 column
.container {
display: grid;
grid-template-rows: auto auto;
}
<h1>Simple grid example</h1>
<div class="container">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
<div>Six</div>
<div>Seven</div>
</div>
2
Answers
You would need to seperate the rows with a wrapper like so:
You can add
grid-auto-flow: column;
to your CSS. (See https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow)This will specify that your cells will flow column-wise.