I'm using the following:
HTML
<table id="tracks" class="BorderedTable"
<tr>
<td style="text-align:center; background-color:#00FFFF">
TITLE
</td>
</tr>
<!-- This is part of a much larger loop that adds several rows -->
<tr class="border_bottom">
<td>
<!-- I want to add a column after whichever of this row was clicked on -->
<a onclick="addTableRow($('#tracks'));" > +/- </a>
</td>
</tr>
</table>
JQUERY
function addTableRow(jQtable){
jQtable.each(function(){
var $table = $(this);
// Number of td's in the last table row
var n = $('tr:last td', this).length;
var tds = '<tr>';
for(var i = 0; i < n; i++){
tds += '<td> </td>';
}
tds += '</tr>';
if($('tbody', this).length > 0){
$('tbody', this).append(tds);
}else {
$(this).append(tds);
}
});
}
This adds a row at the end of the table. How can I make it add a row after another specific row?