JSFiddle - React, Tailwind, and code Playground

HTML

<body> 
    <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>
</body>

JavaScript

$("#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);

});