I have a data array with multiple cards. Some cards have more content than others. I want to adjust the card height dynamically so that all cards have the same height. how can i achieve this?
<Row>
{data.map((item) => (
<Col xs={12} sm={12} md={6} lg={4} xl={3} xxl={3} className="mb-4">
<Card>
{item.content}
</Card>
</Col>
))}
</Row>```
2
Answers
You can add this style to the container:
You can do this with a grid layout using the
grid-auto-rows
css property.Ex:
All of the cards will be the same height as the tallest card.
Live code: https://jsfiddle.net/dtyu8Lqv/84/