I have this js part of script:
jQuery.each(data, function(index, value) {
$("table_div").append("<td>" + value + "</td>");
});
I want use this for create a table with twitter bootstrap. In the html page there is this table element:
<table class="table table-striped" id="table_div">
</table>
But this solution doesn’t works. How I have to do? Thank you!
First of all, you’re not appending any
<tr>elements which are needed in a table, and secondly you’re referring to$("table_div")instead of$("#table_div")(the hashtag#means that you’re referring to an ID, just like in CSS).