When rendering the 4 items in a row using a for loop, I encounter an issue where the first line renders 4 items correctly but subsequent items are rendered on separate lines.
code
<div class="card-group">
{% for item in wt %}
<div class="card my-3 text-white bg-dark mb-3" style="width: 18rem;">
<img src="/media/{{item.thumbnail}}" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">{{item.product_name}}</h5>
<p class="card-text">{{item.thumbnail_desc}}</p>
<a href="blog_detail/{{item.post_id}}" class="btn btn-primary">View Product</a>
</div>
</div>
{% if forloop.counter|divisibleby:4 %}
</div>
{% endif %}
{% endfor %}
In this implementation, I am utilizing both Bootstrap and Django frameworks. Despite trying to use the "row" class, it does not resolve the issue entirely.