Is it possible to populate a grid starting from the center?
I am working with a CSS grid container that has dynamic content (the number of children is not fixed and gets updated regularly). Here is my current setup:
#container {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
}
When all four columns are filled, it looks like this:
1 2 3 4 //Numbers represent children of containers
This layout works well for me. However, I encounter an issue when there are only two divs inside the main container, resulting in the following configuration:
1 2 0 0
What I would like to achieve is the following instead:
0 1 2 0