TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Damien Sullivan
NA
26
9k
How to create a repeater that makes a new row every 3 items?
Feb 23 2019 11:46 AM
In my .ts file, I have an array of company details.
In my HTML, I'm then using ngFor to display these companies using the following code:
<div class="card-deck">
<div class="card" *ngFor="let company of companies">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">{{ company.companyName }}</h5>
<p class="card-text">Industry: {{ company.industry }} Share Price: {{ company.sharePrice }} Rating: {{ company.starRating }}</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
</div>
This displays the companies on my page, but they are all in one row.
For example, if I have 3 companies, they are all in the same row. If I have 10 companies, they all stay on the same row.
What changes do I need to make so that there is only max 3 companies on one row of cards?
Reply
Answers (
2
)
non-ASCII Characters not allowed in text box Using angular
How to implement Lazy Loading for Mat-Table(Angular Material