Louisa Louisa - 7 months ago 53
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?


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.