FINALLY managed to create a properly working table

Seems like that the answer was mystery that is called "global variable"