日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

easypoi 如何合并相同的列,如何在Java中的POI中使用XWPFTable合并单元格(或应用colspan)?...

發(fā)布時間:2024/9/27 110 豆豆
生活随笔 收集整理的這篇文章主要介紹了 easypoi 如何合并相同的列,如何在Java中的POI中使用XWPFTable合并单元格(或应用colspan)?... 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

Creating a table in poi was quite easy but it has very limited tutorials and I cannot find one that can create a simple merged cell in a table in generating a docx file.

解決方案

If you have created table, row inside a table and cell inside a row, you can add gridSpan to cell properties:

if (cell.getCTTc().getTcPr() == null) cell.getCTTc().addNewTcPr();

if (cell.getCTTc().getTcPr().getGridSpan() == null) cell.getCTTc().getTcPr().addNewGridSpan();

cell.getCTTc().getTcPr().getGridSpan().setVal(2);

Note: cell is org.apache.poi.xwpf.usermodel.XWPFTableCell.

總結(jié)

以上是生活随笔為你收集整理的easypoi 如何合并相同的列,如何在Java中的POI中使用XWPFTable合并单元格(或应用colspan)?...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。