Creating a table with certain number of rows

Hello guys, i wish everyone is ok.

i have a project that consist me to create a table which it should be fill in with data(rows); The data is extracted from a database node with the help of a function node and an inject node(that sends a payload every 5 seconds).
The only problem i'm facing is that i want the table to stop incrementing at a certain number of rows, for example if the 135th row of the table is reached, the table node should stop extracting data from the database node, and after that when i click on a button reset, this button will make be able to clean the table from the oldest rows and begin with injecting new rows with new data values inserted in each column.
i'm very stuck with this problem, i really need the help of someone and until now i tried many propositions of solutions but nothing worked.(i'm just a beginner in node red and i wish to learn it very good , so i think this is a start).

thank you in advance for your replies.

Please do not open duplicate threads, it will not get you answers any faster.

I will close this thread as a duplicate.