use of org.docx4j.wml.TcPrInner.TcBorders in project docx4j-template by vindell.
the class Docx4jStyle_S3 method setCellBorders.
public void setCellBorders(Tc tableCell, boolean borderTop, boolean borderRight, boolean borderBottom, boolean borderLeft) {
TcPr tableCellProperties = tableCell.getTcPr();
if (tableCellProperties == null) {
tableCellProperties = new TcPr();
tableCell.setTcPr(tableCellProperties);
}
CTBorder border = new CTBorder();
// border.setColor("auto");
border.setColor("0000FF");
border.setSz(new BigInteger("20"));
border.setSpace(new BigInteger("0"));
border.setVal(STBorder.SINGLE);
TcBorders borders = new TcBorders();
if (borderBottom) {
borders.setBottom(border);
}
if (borderTop) {
borders.setTop(border);
}
if (borderLeft) {
borders.setLeft(border);
}
if (borderRight) {
borders.setRight(border);
}
tableCellProperties.setTcBorders(borders);
}
use of org.docx4j.wml.TcPrInner.TcBorders in project Java-Tutorial by gpcodervn.
the class Docx4jUtils method setCellBorders.
private void setCellBorders(Tc tableCell, boolean borderTop, boolean borderRight, boolean borderBottom, boolean borderLeft) {
TcPr tableCellProperties = tableCell.getTcPr();
if (tableCellProperties == null) {
tableCellProperties = new TcPr();
tableCell.setTcPr(tableCellProperties);
}
CTBorder border = new CTBorder();
// border.setColor("auto");
border.setColor("0000FF");
border.setSz(new BigInteger("20"));
border.setSpace(new BigInteger("0"));
border.setVal(STBorder.SINGLE);
TcBorders borders = new TcBorders();
if (borderBottom) {
borders.setBottom(border);
}
if (borderTop) {
borders.setTop(border);
}
if (borderLeft) {
borders.setLeft(border);
}
if (borderRight) {
borders.setRight(border);
}
tableCellProperties.setTcBorders(borders);
}
Aggregations