JSFiddle - React, Tailwind, and code Playground
HTML
<TABLE id="dataTable" border="1">
<tr>
<td><input type="text" /></td>
<td><input type="text" /></td>
<td>
<input type="radio" name="radio0" onClick="toggleDisplay();"/>Own
<input type="radio" name="radio0" onClick="toggleDisplay();"/>Contractor
<div style="display:none;">
<input type="radio" name="Wage" value="Wage"/>Wage Board
<input type="radio" name="Staff" value="Staff"/>Staff
</div>
<div style="display:none;">
Name Of Contractor: <input type="text" name = "text" />
<input type="radio" name="No" />No of Workmen
</div>
</td>
<td><input type="text" /></td>
<td><input type="text" /></td>
</tr>
</TABLE>
<input type=button onclick="addRow('dataTable')" value="add row" />
JavaScript
addRow = function(tableID) {
var table = document.getElementById(tableID);
var oClone = table.rows[0].cloneNode(true);
$(oClone).find("input[type=radio]").each(function(){
$(this).attr("name", "radio"+table.rows.length);
});
$(oClone).find("div").hide();
table.insertBefore(oClone);
};
toggleDisplay = function() {
var target = event.target || event.srcElement;
$(target).closest("td").find("div").hide();
$(target).closest("td").find("div:eq("+$(target).index("input[name="+$(target).attr("name")+"]")+")").toggle();
};