How to add the rows in the input table?