Bonjour,
Voici un small exemple d’un tableau dynamique avec id incrémental et jQuery powered
<button id="add_line">Ajouter une ligne</button>
<table id="matable" border="1">
<tr id="row_1">
<td>Une cellule</td>
<td>Une cellule</td>
<td>Une cellule</td>
</tr>
</table>
<table id="matable" border="1">
<tr id="row_1">
<td>Une cellule</td>
<td>Une cellule</td>
<td>Une cellule</td>
</tr>
</table>
$("#add_line").click(function () {
var last_row = $('#matable tr:last');
var new_id = parseInt($(last_row).attr('id').split("_")[1]) + 1;
$(last_row).clone().insertAfter('#matable tr:last').attr('id', 'row_' + new_id);
});
var last_row = $('#matable tr:last');
var new_id = parseInt($(last_row).attr('id').split("_")[1]) + 1;
$(last_row).clone().insertAfter('#matable tr:last').attr('id', 'row_' + new_id);
});