I have an issue when i'm trying to add rows in a table using Javascript and jQuery.
My code:
<script>
$(document).ready(function(){
for (i=0; i<myvar.length; i++){
$("#items").after('<tr class="item-row"><td class="item-name"></td></tr>');
}
});
</script>
My problem is that the new row did not take the style of my CSS file. CSS file loaded in <head>.
Did i miss something?
#itemsis the table, then you should use$("#items").append, not.afterto add the elements to the table, not next to it.