Alex Polkhovsky
Alex Polkhovsky

Reputation: 3360

knockout.js foreach position elements in rows

I am using Twitter Bootstrap template for my MVC4 single page application. My model view returns a list of 120 words. I'd like to position them in 10 rows of 12. The output markup should be similar to this:

<div class="row">
<div class="span1">word1</div>
.
.
.
</div>
<div class="row">
<div class="span1">word13</div>
.
.
.
</div>

How would I accomplish something like that?

Upvotes: 1

Views: 382

Answers (1)

KodeKreachor
KodeKreachor

Reputation: 8882

Here's one approach you can take, this example leveraged the MVVM pattern to parse out your twitter string and bind it to your view using template bindings: http://jsfiddle.net/KodeKreachor/78pvN/

Upvotes: 1

Related Questions