The following works. It was missing the '#' in table_id.
$("div1").each(function(index){
var table_id = "peak_table_"+index;
$(this).html('<table cellpadding="0" cellspacing="0" border="0" class="display table table-striped table-bordered" id="'+table_id+'"></table>');
$("#"+table_id).dataTable( {
"aaData": {{ table_data|safe }},
"aoColumns": {{ table_headings|safe }}
});
});