Found a way to dynamically create a table class, see getNewTable