Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap two column layout and ng-repeat (angularjs)

I'm trying to create a two col layout with ng-repeat.

<div class="row">
   <div class="col-md-6" ng-repeat="item in items">
       Item: {{item}}
   </div>
</div>

This results in the following problem:

enter image description here

P.S. This problem has been answered before with native CSS cols but I want to do it with bootstrap.

P.S. The solution proposed below is not working.. anyone got any other ideas please?

like image 976
supersan Avatar asked Feb 19 '26 17:02

supersan


1 Answers

You'll have to break it into two seperate columns, but it should be pretty easy after that:

<div class="row">
   <div class="col-md-6" ng-repeat="item in items | limitTo: items.length /2: 0">
       Item: {{item}}
   </div>
   <div class="col-md-6" ng-repeat="item in items | limitTo: items.length /2: items.length /2">
       Item: {{item}}
   </div>   
</div>
like image 137
Mathew Berg Avatar answered Feb 21 '26 05:02

Mathew Berg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!