Search in sources :

Example 16 with TblBorders

use of org.docx4j.wml.TblBorders in project docx4j-template by vindell.

the class WordprocessingMLPackageRender method addBorders.

/**
 *  本方法给表格添加边框
 */
public void addBorders(Tbl table) {
    table.setTblPr(new TblPr());
    CTBorder border = new CTBorder();
    border.setColor("auto");
    border.setSz(new BigInteger("4"));
    border.setSpace(new BigInteger("0"));
    border.setVal(STBorder.SINGLE);
    TblBorders borders = new TblBorders();
    borders.setBottom(border);
    borders.setLeft(border);
    borders.setRight(border);
    borders.setTop(border);
    borders.setInsideH(border);
    borders.setInsideV(border);
    table.getTblPr().setTblBorders(borders);
}
Also used : CTBorder(org.docx4j.wml.CTBorder) BigInteger(java.math.BigInteger) TblBorders(org.docx4j.wml.TblBorders) TblPr(org.docx4j.wml.TblPr)

Example 17 with TblBorders

use of org.docx4j.wml.TblBorders in project docx4j-template by vindell.

the class BorderUtils method tblBorders.

public static TblBorders tblBorders(CTBorder border) {
    TblBorders borders = new TblBorders();
    borders.setBottom(border);
    borders.setLeft(border);
    borders.setRight(border);
    borders.setTop(border);
    borders.setInsideH(border);
    borders.setInsideV(border);
    return borders;
}
Also used : TblBorders(org.docx4j.wml.TblBorders)

Example 18 with TblBorders

use of org.docx4j.wml.TblBorders in project docx4j-template by vindell.

the class TableWithBorders method addBorders.

private static void addBorders(Tbl table) {
    table.setTblPr(new TblPr());
    CTBorder border = new CTBorder();
    border.setColor("auto");
    border.setSz(new BigInteger("4"));
    border.setSpace(new BigInteger("0"));
    border.setVal(STBorder.SINGLE);
    TblBorders borders = new TblBorders();
    borders.setBottom(border);
    borders.setLeft(border);
    borders.setRight(border);
    borders.setTop(border);
    borders.setInsideH(border);
    borders.setInsideV(border);
    table.getTblPr().setTblBorders(borders);
}
Also used : CTBorder(org.docx4j.wml.CTBorder) BigInteger(java.math.BigInteger) TblBorders(org.docx4j.wml.TblBorders) TblPr(org.docx4j.wml.TblPr)

Aggregations

TblBorders (org.docx4j.wml.TblBorders)18 TblPr (org.docx4j.wml.TblPr)10 CTBorder (org.docx4j.wml.CTBorder)9 BigInteger (java.math.BigInteger)8 Tbl (org.docx4j.wml.Tbl)6 Test (org.junit.Test)6 TcPrInner (org.docx4j.wml.TcPrInner)3 HashMap (java.util.HashMap)1 STBorder (org.docx4j.wml.STBorder)1