@Override public String getContent() { String withStyle = style.getNewContentWithStyle(txt.toString()); return withStyle; }
@Override public TableCellStyle withStyle() { style.setElement(this); return style; }
@Override public String getNewContentWithStyle(String txt) { doStyleBgColor(style); doStyleGridSpan(style); if(!"".equals(style.toString())){ style.insert(0, "<w:tcPr>"); style.append("</w:tcPr>\n"); } return txt.replace("{styleCellPh}", style); }
tbl.addRow( TableRow.with( TableCell.with(Paragraph.with("TableCell- Style to the whole cell, Par").create()), "Simple String" ).withStyle().bold().create() ); tbl.addRow( TableRow.with("Style to the whole cell, Str", "String").withStyle().bold().create() ); tbl.addRow( TableRow.with( TableCell.with(Paragraph.with("TableRowV2 with merge").create()).withStyle().gridSpan(2).create() ).withStyle().bold().create() ); tbl.addRow( TableRow.with( TableCell.with(Paragraph.withPieces( ParagraphPiece.with("Paragraph with Style inside TableCell").withStyle().bold().fontSize("20").create() ).create()).withStyle().bgColor("00FFFF").create(), "String" ));
@Override public String getNewContentWithStyle(String txt) { doStyleBgColor(style); doStyleGridSpan(style); if(!"".equals(style.toString())){ style.insert(0, "<w:tcPr>"); style.append("</w:tcPr>\n"); } return txt.replace("{styleCellPh}", style); }
@Override public String getContent() { String withStyle = style.getNewContentWithStyle(txt.toString()); return withStyle; }
@Override public TableCellStyle withStyle() { style.setElement(this); return style; }