/** * Set cell color. This sets some associated values; for finer control * you may want to access these elements individually. * * @param rgbStr - the desired cell color, in the hex form "RRGGBB". */ public void setColor(String rgbStr) { CTTcPr tcpr = getTcPr(); CTShd ctshd = tcpr.isSetShd() ? tcpr.getShd() : tcpr.addNewShd(); ctshd.setColor("auto"); ctshd.setVal(STShd.CLEAR); ctshd.setFill(rgbStr); }
public static void styleTable(XWPFTable table, TableStyle style) { if (null == table || null == style) return; CTTblPr tblPr = table.getCTTbl().getTblPr(); if (null == tblPr) { tblPr = table.getCTTbl().addNewTblPr(); } if (null != style.getAlign()) { CTJc jc = tblPr.isSetJc() ? tblPr.getJc() : tblPr.addNewJc(); jc.setVal(style.getAlign()); } if (StringUtils.isNotBlank(style.getBackgroundColor())) { CTShd ctshd = tblPr.isSetShd() ? tblPr.getShd() : tblPr.addNewShd(); ctshd.setColor("auto"); ctshd.setVal(STShd.CLEAR); ctshd.setFill(style.getBackgroundColor()); } }
/** * Set cell color. This sets some associated values; for finer control * you may want to access these elements individually. * * @param rgbStr - the desired cell color, in the hex form "RRGGBB". */ public void setColor(String rgbStr) { CTTcPr tcpr = getTcPr(); CTShd ctshd = tcpr.isSetShd() ? tcpr.getShd() : tcpr.addNewShd(); ctshd.setColor("auto"); ctshd.setVal(STShd.CLEAR); ctshd.setFill(rgbStr); }
/** * Set cell color. This sets some associated values; for finer control * you may want to access these elements individually. * @param rgbStr - the desired cell color, in the hex form "RRGGBB". */ public void setColor(String rgbStr) { CTTcPr tcpr = ctTc.isSetTcPr() ? ctTc.getTcPr() : ctTc.addNewTcPr(); CTShd ctshd = tcpr.isSetShd() ? tcpr.getShd() : tcpr.addNewShd(); ctshd.setColor("auto"); ctshd.setVal(STShd.CLEAR); ctshd.setFill(rgbStr); }
ctshd.setColor("auto"); ctshd.setVal(STShd.CLEAR); if (rowCt == 0) {
CTVerticalJc va = tcpr.addNewVAlign(); CTShd ctshd = tcpr.addNewShd(); ctshd.setColor("auto"); ctshd.setVal(STShd.CLEAR);
CTVerticalJc va = tcpr.addNewVAlign(); CTShd ctshd = tcpr.addNewShd(); ctshd.setColor("auto"); ctshd.setVal(STShd.CLEAR);
CTVerticalJc va = tcpr.addNewVAlign(); CTShd ctshd = tcpr.addNewShd(); ctshd.setColor("auto"); ctshd.setVal(STShd.CLEAR);