Reputation: 2169
I have a jquery script that on the occurrence of an event changes a div and adds a table as shown in the following code. The page is based on Bootstrap CSS but the table is not formatted as it should. What am i doing wrong?
$('#regionId').html('<table class="table">');
for (var i = 0; i < data.length; i++) {
$('#regionId').append('<tr><td>'+ data[i].field + ' </td> <td>' + data[i].field2+ '</td></tr>');
}
$('#regionId').append('</table>');
Upvotes: 2
Views: 934