dqkit wrote:but..but,when there is too much text in an cell, the text would be placed into many rows
Yes, you'd need a model of how many lines the text would be rendered in, and for that - depending how well you need to do it - you may need to deal with glyph sizes, kerning tables, and ligature information.
docx4j doesn't have anything like this right now.
It would be an interesting feature; and ultimately would help people who want to calculate page numbers.
You could use Java 2D's TextLayout. Search for 'LineBreakMeasurer'. I'm not sure whether this would be the best way - it might not handle hyphenation for example. There are other layout engines you could look at, including FOP, ICU.
May I ask why you need to know the table height?