NPOI 设置world表格单元格居中

   private static XWPFTableCell CreateCell(XWPFTableRow row)
        {
            XWPFTableCell cell = row.CreateCell();
            CT_Tc cttc = cell.GetCTTc();
            CT_TcPr ctPr = cttc.AddNewTcPr();
            //ctPr.AddNewVAlign().val = ST_VerticalJc.center; //垂直居中
            cttc.GetPList()[0].AddNewPPr().AddNewJc().val = ST_Jc.center; //水平居中
            return cell;
        }

 

posted @ 2021-05-29 22:52  _York  阅读(271)  评论(0编辑  收藏  举报