Example #5: create dynamic tables with instant loops

Imagine you want to add very many table rows automatically so you can fill them with dynamic content.
E.g. a 30 x 200 sized table. Then you need only one callback method creating each cell. The rest is done via a single jQuery chain:


function createCell(x,y) {
    $('<td>').text(x+':'+y).appendTo(this);
}

$.repeat().$('<tr>').repeat(createCell).until(30)
  .appendTo('tbody').until(200);
My dynamic data:

Other examples with callbacks

Other examples with closed loops

Other examples with instant loops

Other examples with repeat-loops