JSFiddle - React, Tailwind, and code Playground

HTML

<table id="amort">
</table>

CSS

td { border: solid 1px silver;}

JavaScript

$( function(){
cont={1:['EMPRUNT',' Montant','Durée(mois)','taux','mensualité',' 80','200','300'],
2:['Credit 1',' 250 000','300','3','1185.53€','922.57','922.57','1956.33'],
3:['Credit 2',' 30 000','80','5','441.74€','441.74','0','0'],
4:['Credit 3',' 125 000','200','3.5','804.15€','592.02','1033.76','0'],
5:['Total ',' 405 000','-------','3.5','-----------','1956.33','1956.33','1956.33']
}
//replissage du tableau
$.each(cont, function(idx,vals){
 $line=$('<tr/>');
 $.each(vals, function(cellidx,cellval){
 		$cell=$('<td/>').html(cellval);
    $line.append($cell);  
  });
 $('#amort').append($line);
})


function sortduree($a,$b){
return  ( +$($a).find('td:eq(2)').html() > +$($b).find('td:eq(2)').html() ) ?1 : -1;
}

$tablines = $('#amort tr:gt(0)');
$total = $tablines.last();

$tablines.sort(sortduree);
$('#amort').append($tablines);
$('#amort').append($total);




})