I have some cards, I want to make it looks like this
[] [] []
[] [] []
[] [] []
...
...
I have a problem rendering the item with map function. I already try this but it doesn't work. For every index if the index divisible by 3 I wanted to make new row. How I can do that?
{products.map((val, index) => (
{ index%3 == 0 ? <div className="row mx-auto"> : null}
<Card>
{val.description}
</Card>
{ index%3 == 0 ? </div> : null}
))}
Any help would be appreciated.