How to add column on all rows (including header row) using jQuery. The added column will be the first column.
WHat I have understand from your question, here is the code for you
$('#tableID tr:first ').append("<td class='TableHeading'>second</td>");
$('#tableID tr:not(:first)').each(function(){
$(this).append("<td class='tdMiddleCells'>second</td>");
});
Here you can loop through the table rows and then adding the column in each of the row. this will add column to last location, the first statement will add column as header and then remaining rows.
hope that will help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With