Quantcast
Channel: Java Programming Forum - Learn Java Programming - Apache POI
Viewing all articles
Browse latest Browse all 120

Change the font-size from a table in a word-document using poi and XWPF

$
0
0
Hello :-)

I change a table in a word-document with poi.
Anybody haven an idea how could I change the font-size/font of my text in each cell?

Code:

private void adText2Table(XWPFDocument doc, String text, int row, int cell, int tableIdx) {

                XWPFTableRow xWPFTableRow;
                XWPFTable table = doc.getTables().get(tableIdx);
                List<XWPFTableRow> zeile = table.getRows();

                if (zeile.size() >= row + 1) {
                        xWPFTableRow = zeile.get(row);
                } else {
                        xWPFTableRow = doc.getTables().get(tableIdx).createRow();
                }

                xWPFTableRow.getCell(cell).setText(text);
        }

Best regards and thanks for reading it,

Louisa

Viewing all articles
Browse latest Browse all 120

Trending Articles