I have a situation where number of rows should be 3 and if there are more items it should go to next column. That is each column should only have three items
I did like this
.sub-options-container {
display: grid;
grid-template-rows: repeat(3, auto);
grid-template-columns: repeat(3, auto);
}
But this will only go up to 3 columns, but I wanted it to add dynamically more columns depending on more items added, but each column should only have three rows
I am able to achieve this if I wanted fixed columns and dynamically adding rows by simply only defining columns as shown
.sub-options-container {
display: grid;
grid-template-columns: auto auto auto;
}
I cant find a solution in stackoverflow, sorry if this is asked