How can I create a grid index view of products like aliexpress

I want my products to display in groups of div’s all the same size like 5 to a row similar to aliexpress I’m new to e-commerce

they use flexbox - you just list them and they break line when the size changes and make boxes as long as you have products to put in there. You don’t want 5 items per line on my smartphone in portrait mode and really big screen might accomodate 6 in a row. I don’t use flexbox since grid came out but I think that is what you want.