1、填充Word表格内容/**
* 循环填充表格内容
* @param xwpfDocument
* @param params
* @param tableIndex
* @throws Exception
*/
private void insertValueToTable(XWPFDocument xwpfDocument, List> params, int tableIndex) throws Exception {
try {
List tableList = xwpfDocument.getTables();
if (tableList.size() <= tableIndex) {
throw new Exception("tableIndex对应的表格不存在");
}
XWPFTable table = tableList.get(tableIndex);
List rows = table.getRows();
if (rows.size() < 2) {
throw new Exception("tableIndex对应表格应该为2行");
}
//模板的那一行
XWPFTableRow tmpRow = rows.get(1);
List tmpCells = null;
List cells = null;
XWPFTableCell tmpCell = null;
tmpCells = tmpRow.getTableCells();</