below is my code.
$("<table/>",{"cellspacing":"0","cellpadding":"0","border":"0","width":"100%"})
.append(
$("<tbody/>")
.append(function(){
options=["ONE","TWO","THREE","FOUR"];
$.each(options, function(val) {
return ($("<tr/>")
.append(
$("<td/>").html("4/6/2013 10:41"),
$("<td/>").html("5/6/2013 10:42"),
$("<td/>").html(val),
$("<td/>").html("<img src='pdf_16x16.png'/>"),
$("<td/>").html("<a href='#'>Re-Upload Documents</a>")
));
})
})
).appendTo("body");
for loop inside the append is not working.
Try like
The problem is because you are not returning anything from the
append
function, only theeach
loop within it. Try this:Example fiddle
Try
Demo: Fiddle
try following:
working fiddle here: http://jsfiddle.net/mCLsm/2/