JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css">
<table class="testtable">
<tr id='0'>
<td class='editable' style="border:1px solid #000;padding:7px">Title</td>
<td class='editable' style="border:1px solid #000;padding:7px">0 mins</td>
<td class='editable' style="border:1px solid #000;padding:7px">Genre</td>
<td class='editable' style="border:1px solid #000;padding:7px">[]</td>
<td class='editable' style="border:1px solid #000;padding:7px">0</td>
<td style="color:blue">0</td>
<td>
<button id="editButton"style="background-color:#ADD8E6"/>🖉
</td>
<td >
<button style="background-color:#F08080"/>⛌
</td>
</tr>
</table>
CSS
.table {
margin-left: 20px;
width: 80%;
}
.input {
margin-left: 20px;
width: 10px;
}
.td {
margin-right: 10px;
}
JavaScript
$("#editButton,#saveable").click(function() {
if ($(this).attr('id') === "editButton") {
$(this).parent().parent().children(".editable").html("<input name='test[]' type='text' id='editable' value=''/>");
$(this).attr("id", "saveable")
} else {
let Inputhtml ='';
$(this).closest("tr").find(".editable input").each(function(i) {
Inputhtml +="<td>" + $(this).val() + "</td>";
//$(".testtable").html("<td>" + $(this).val() + "</td>")
})
Inputhtml +='<td><button id="editButton"style="background-color:#ADD8E6">🖉</button></td><td><button style="background-color:#F08080">⛌</button></td>';
$(".testtable").html(Inputhtml);
/* $(this).attr("id", "editButton") */
}
});