Louisa Louisa - 10 months ago 104
Java Question

HWPF-POI: inserting table in word with java

I want to create a table in Word with POI-HWPF (e.g. doc format).
My example code is:

Table table = document.getRange().insertTableBefore((short) 2, 2);

The table is inserted, but I can't see it - as if the table has the width 0.
Can anybody help me?

Answer Source

The file linked in this old bug report should give you an idea how to do it.

So in essence: You probably need to add some content (i.e. a paragraph in a cell) so that Word has something to render.