This is a chicken or egg dilemma: these properties will be filled after the document was rendered.
With "make sure" I meant to use a limit in your code.
E. g. for an invoice table, only use KeepWith if there are less than e. g. 20 rows (or even less if there can be long texts in the rows).
I don't know what's in your table so I don't know whether or not this is possible.
I'm not sure what will happen if you try to force the program to put something on one page that is too big to fit:
- maybe it'll break
- maybe it'll look ugly (drawing beyond the page boundary)
- maybe it'll get stuck in an endless loop (this should not happen (if it happens please report it as a bug))