im playing with css 3 grid and i have one question. I created demo:
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
<li>11</li>
<li>12</li>
<li>13</li>
<li>14</li>
<li>15</li>
</ul>
ul
{
border: 3px solid goldenrod;
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: 50px;
margin: 0;
padding: 0;
grid-gap: 10px;
}
li
{
background: pink;
margin: 0;
padding: 0;
list-style: none;
text-align: center;
line-height: 50px;
}
link: http://jsbin.com/mosijijewe/edit?html,css,output
Expected result is
1 | 2 | 3
4 | 5 | 6
7 | 8 | 9
etc.
My question: is possible to get with some grid value or some trick example below? (without some manual definition, because I do not know how many lines will be in advance)
1 | 4 | 7
2 | 5 | 8
3 | 6 | 9