While attempting to dynamically add rows to a table using Javascript and jQuery, I encountered an issue.
Here is 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>
The problem at hand is that the new row does not inherit the styling from my CSS file which is linked in the <head>
.
Could it be possible that I overlooked something?