Hi there. Not identical but I had a similar problem, in my case I was creating a form which had a large number of inputs (>30). If the fields are all of the same type (e.g. numeric), then it's easier to manage as a table:
I created a database table ("skeleton") with columns of: field_name_id, category, field name, sort order
I then created another table ("values") which can hold entries of: entry_id, field_name_id (from above), field_value
You then create a left join of those two which will always return all the fields from both tables, but field_value will by default be blank;
On save you just save the values into the second table (values)
In this example, the 'white' columns come from the 'skeleton', and the coloured columns come from the 'values' table
For me this meant that I can add in new 'fields' by creating new entries in the "skeleton" table without having to create new form fields every time. In your case you could just have an add new row button or similar.
It does sound like you are describing a one-to-many relationship so, if using a conventional third-normal-form SQL database, a two-table structure would make more sense.
HTH