angular – Styling dom elements powered by ngfor

Context: So I'm getting data from the background that I'm storing in a table on my angular front end. Now, I try to display each of these elements (which are products) on the model. What I'm essentially trying to achieve are products on a page that users can browse.

Problem: The problem is that ngfor simply draws elements one after the other following a vertical line on the model. What I want is to be able to apply general style settings so that items move from the top left of the page to the top right in a row from 1 to X number of items depending on the width of the display window, and then continue as such on the following items. the lines until there is none left in the original chart.

I would be grateful if anyone could point me in the direction from which I could reach the desired result.