I'm using jquery to dynamically add columns and rows to the table.
The problem I'm having is that I'm adding the rows with code as below:
$('#colorgrid').append("<tr id='Row2' class='input-row'><td><input type='text' name='shade' placeholder='shade'/></td><td ><input type='checkbox' name='asdf'/></td><td ><input type='checkbox' name='shade'/></td><td ><input type='checkbox' name='color'/></td></tr>")
So after I add one column and then add one row, it is missing a checkbox. Please see screen shot below:
Ideally whenever new row is added I would like it to fill however many columns there are with checkboxes and fill the name attribute of the checkboxes with the column name.
Question
How can I add a new row such a way so that it is really dynamic and I'm not hardcoding the contents of the row. It should fill all the columns with checkboxes and name them corresponding to the columnheader.
