I did something similar when creating my own dynamic table without using table plugins. Try check it out and see if it can help you:
I did something similar when creating my own dynamic table without using table plugins. Try check it out and see if it can help you: