Form Rows

I am looking to make a pretty simple Compound Interest Calculator. I want the User to fill out a form of ‘Years’, ‘Net Worth’, ‘Interest Rate’. I want a data table to populate the number of rows = Years Input’ but am struggling to do this. For example, if user enters 5 years then I want 5 rows to be created ‘Year 1’ Year 2’, etc with the Net Worth calculated for each one. How can I achieve this?

You can only do that with API, Use the button to add a row (year) instead of a number entry.