Search in sources :

Example 6 with CTTblPr

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr in project poi by apache.

the class XWPFTable method setRowBandSize.

public void setRowBandSize(int size) {
    CTTblPr tblPr = getTrPr();
    CTDecimalNumber rowSize = tblPr.isSetTblStyleRowBandSize() ? tblPr.getTblStyleRowBandSize() : tblPr.addNewTblStyleRowBandSize();
    rowSize.setVal(BigInteger.valueOf(size));
}
Also used : CTDecimalNumber(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber) CTTblPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr)

Example 7 with CTTblPr

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr in project poi by apache.

the class XWPFTable method getInsideVBorderSpace.

public int getInsideVBorderSpace() {
    int space = -1;
    CTTblPr tblPr = getTrPr();
    if (tblPr.isSetTblBorders()) {
        CTTblBorders ctb = tblPr.getTblBorders();
        if (ctb.isSetInsideV()) {
            CTBorder border = ctb.getInsideV();
            space = border.getSpace().intValue();
        }
    }
    return space;
}
Also used : CTTblBorders(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders) CTBorder(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBorder) CTTblPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr)

Example 8 with CTTblPr

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr in project poi by apache.

the class XWPFTable method getCellMarginRight.

public int getCellMarginRight() {
    int margin = 0;
    CTTblPr tblPr = getTrPr();
    CTTblCellMar tcm = tblPr.getTblCellMar();
    if (tcm != null) {
        CTTblWidth tw = tcm.getRight();
        if (tw != null) {
            margin = tw.getW().intValue();
        }
    }
    return margin;
}
Also used : CTTblWidth(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth) CTTblPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr) CTTblCellMar(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblCellMar)

Example 9 with CTTblPr

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr in project poi by apache.

the class XWPFTable method createEmptyTable.

private void createEmptyTable(CTTbl table) {
    // MINIMUM ELEMENTS FOR A TABLE
    table.addNewTr().addNewTc().addNewP();
    CTTblPr tblpro = table.addNewTblPr();
    tblpro.addNewTblW().setW(new BigInteger("0"));
    tblpro.getTblW().setType(STTblWidth.AUTO);
    // layout
    // tblpro.addNewTblLayout().setType(STTblLayoutType.AUTOFIT);
    // borders
    CTTblBorders borders = tblpro.addNewTblBorders();
    borders.addNewBottom().setVal(STBorder.SINGLE);
    borders.addNewInsideH().setVal(STBorder.SINGLE);
    borders.addNewInsideV().setVal(STBorder.SINGLE);
    borders.addNewLeft().setVal(STBorder.SINGLE);
    borders.addNewRight().setVal(STBorder.SINGLE);
    borders.addNewTop().setVal(STBorder.SINGLE);
    /*
         * CTTblGrid tblgrid=table.addNewTblGrid();
         * tblgrid.addNewGridCol().setW(new BigInteger("2000"));
         */
    getRows();
}
Also used : CTTblBorders(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders) CTTblPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr) BigInteger(java.math.BigInteger)

Example 10 with CTTblPr

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr in project poi by apache.

the class XWPFTable method getInsideVBorderColor.

public String getInsideVBorderColor() {
    String color = null;
    CTTblPr tblPr = getTrPr();
    if (tblPr.isSetTblBorders()) {
        CTTblBorders ctb = tblPr.getTblBorders();
        if (ctb.isSetInsideV()) {
            CTBorder border = ctb.getInsideV();
            color = border.xgetColor().getStringValue();
        }
    }
    return color;
}
Also used : CTTblBorders(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders) CTBorder(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBorder) CTTblPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr) CTString(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTString)

Aggregations

CTTblPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr)26 CTTblBorders (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders)11 CTBorder (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBorder)10 CTTblWidth (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth)7 CTString (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTString)6 CTTblCellMar (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblCellMar)5 CTDecimalNumber (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber)4 BigInteger (java.math.BigInteger)3 XWPFParagraph (org.apache.poi.xwpf.usermodel.XWPFParagraph)3 XWPFTable (org.apache.poi.xwpf.usermodel.XWPFTable)3 XWPFTableCell (org.apache.poi.xwpf.usermodel.XWPFTableCell)3 XWPFTableRow (org.apache.poi.xwpf.usermodel.XWPFTableRow)3 FileOutputStream (java.io.FileOutputStream)2 OutputStream (java.io.OutputStream)2 XWPFDocument (org.apache.poi.xwpf.usermodel.XWPFDocument)2 XWPFRun (org.apache.poi.xwpf.usermodel.XWPFRun)2 CTHeight (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHeight)2 CTShd (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTShd)2 CTTbl (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl)2 CTTcPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr)2