I have the following function:
function displayResults(Items) {
$(\"#result\").text(\"\");
$(\"#result\").append(\'
This is an issue I've just come across too. An option is to create the div containers first in a loop then populate them after as you require:
for(var i = 0; i < 12; i++){
$(el).append(''); // create container li tags
//fill empty li tags with content
for(var j = 0; j < 2; j++){
$(el).find('li').last().append('');
}
}