See CellUtil
https://poi.apache.org/apidocs/org/apache/poi/ss/util/CellUtil.html
On Jan 22, 2016 1:25 AM, "Melody" <[email protected]> wrote:
> Hi !
> Thank you very much for creating such a wonderful project of Apache POI
> which
> helps a lot. And I really appreciate it.
> However, I have encountered a problem when using CellStyle.
> At present, to create a CellStyle, the common way is:
> Workbook wb = WorkbookFactory.create(new File(""));
> CellStyle cellStyle = wb.createCellStyle(); // first create a Workbook
> then create a CellStyle
>
>
> That means, all cells share the same CellStyle. So the problem is:
> How can I set different CellStyle for different Cells ?
> Say,
> CellStyle cellStyle1;
> CellStyle cellStyle2;
> cell1.setCellStyle(cellStyle1);
> cell2.setCellStyle(cellStyle2);
>
>
> Very much appreciated for your reply.
>
> Yours Sincerely