Is there a way to extract dynamic table from pdf using document understanding?

I have used document understanding in my project but whenever we get a new sample from client the no. of rows are different in each document and it fails to extract the correct data.

I have used form extractor, but I can train my BOT only on 1 type of pdf, if I train my BOT for maximum no. of rows we may then in the cases where no. of rows are less, we even get the data which is out of the table.

I have browsed almost everywhere but couldn’t find a solution to it please help as i need to deliver my task.