The grid-auto-flow CSS property specifies exactly how auto-placed items get flowed into the grid.
CSS
JS
object.style.gridAutoFlow = "value";
Values
<'grid-auto-flow'> = [ row | column ] || dense
row
Places items by filling each row in turn, adding new rows as necessary.
column
Places items by filling each column in turn, adding new columns as necessary.
dense
Attempts to fill in holes earlier in the grid if smaller items come up later.
Initial
column
column dense
row
row dense
JS
Internal
External