The accepted answer technically works, but I didn’t like that you had to build the data for the logic to work. I think logic should have data. So I came up with the following:
objects = [obj0, obj1, obj2, obj3, obj4, obj5] table thead tbody - var columns = 3 - for (var i = 0; i < objects.length; i=i+columns) tr - for (var j = 0; j < columns && i+j < objects.length; j++) td=objects[i+j]
source share