how can you use insertBefore() when you don’t have the id, class or anything for the table but only the object?
var tbl_elm = $('the table');
$('<tr><td>txt</td></tr>').insertBefore(tbl_elm.eq(0));
somehow I need to tell the eq() that the index has to be found in a ‘TR’ tag
Try this:
However, if the elements you are adding to the table will always be placed before the first row, the below code is better practice: