JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://cloud.github.com/downloads/SteveSanderson/knockout/knockout-2.1.0.js"></script>
<div>
<div data-bind="foreach: sections">
<section data-bind="foreach: $data">
<div data-bind="text:$data">
</div>
</section>
</div>
</div>
CSS
section{width:20px; height:150px; border:2px solid black;}
JavaScript
var vm = function() {
var self = this;
this.tests = ko.observableArray([1,2,3,4,5,6,7,8,9,
10,11,12,13,14,15,16]);
this.sections = [];
this.createSections = ko.computed(function(){
var tests = self.tests();
console.log(tests.length);
for(var i = 0; i < tests.length; i++)
{
if(i%6 == 0)
self.sections.push([]);
self.sections[self.sections.length - 1].push(tests[i]);
}
});
};
ko.applyBindings(new vm());