Here almost we have completed the functionality.When we clicking on add button of each row will create a new table in a row.Here the problem is while clicking the first main add button
its appending to next row of the second main row.
It should come in order while clicking the corresponding row means the sub table row should come.
try:
in addEvent function
in addSubRow function:
example:
in action