XWPFDocument 生成表格时需要设置字体样式
poi提供方法
XWPFTableCell cell = xwpfTable.getRow(0).getCell(0); cell1.setText("333"); XWPFRun run = cell.getParagraphs().get(0).createRun(); run.setColor("ffffff");
导出后颜色不生效 333 还是黑色
问题所在 要想让表格中字体样式生效给表格赋值应该使用
run.setText(); 而不是cell1.setText("");