I am using this to add a row dynamically to a table:
$('#myTable tr:last').after('<tr><td>1</td><td>a</td></tr>'); but it doesn't seem to work if the table has no records:
<table id="myTable" class="altTable"> <thead> <tr> <th> Col1 </th> <th> Col2 </th> </tr> </thead> <tbody> </tbody> </table> what would be the right selector here to add a row that would work if there are 0 or > 0 rows existing ?