You can add or remove tables, body rows, header rows, and footer rows by adding instance manager scripting expressions to objects on your form using the Script Editor.
If it is not already visible, display the Script Editor by selecting Palettes > Script Editor. Expand the Script Editor so that it is displayed in multiline view.
Ensure that the table that you want to add instances to is contained within a flowed subform so that you can add new instances of either the table or the rows within the table.
2.
Type one of the following scripts in the Script Editor, where Table1 and Row1 are the names of the table and table row to add instances to:
Table1.instanceManager.addInstance(true) // Default instance manager syntax
Table1.Row1.instanceManager.addInstance(true) // Default instance manager syntax
xfa.form.recalculate(true) // Invoke the recalculate method to include the field values from the added table or row in the form calculations.
Table1.addInstance(true) // Short form of the instance manager syntax
Table1._Row1.addInstance(true) // Short form of the instance manager syntax
xfa.form.recalculate(true) // Invoke the recalculate method to include the field values from the added table or row in the form calculations.
Table1.instanceManager.addInstance(true); // Default instance manager syntax
Table1.Row1.instanceManager.addInstance(true); // Default instance manager syntax
xfa.form.recalculate(true); // Invoke the recalculate method to include the field values from the added table or row in the form calculations.
Table1.addInstance(true); // Short form of the instance manager syntax
Table1._Row1.addInstance(true); // Short form of the instance manager syntax
xfa.form.recalculate(true); // Invoke the recalculate method to include the field values from the added table or row in the form calculations.
2.
Type one of the following scripts in the Script Editor, where Table1 and Row1 are the names of the table and table row to remove instances from and integer is the zero-based index number of the instance to remove:
Table1.instanceManager.removeInstance(true) // Default instance manager syntax
Table1.Row1.instanceManager.removeInstance(true) // Default instance manager syntax
Table1.removeInstance(true) // Short form of the instance manager syntax
Table1._Row1.removeInstance(true) // Short form of the instance manager syntax
Table1.instanceManager.removeInstance(true); // Default instance manager syntax
Table1.Row1.instanceManager.removeInstance(true); // Default instance manager syntax
Table1.removeInstance(true); // Short form of the instance manager syntax
Table1._Row1.removeInstance(true); // Short form of the instance manager syntax
See also 

To add and remove tables and table rows by using scripting