Java – how to use Apache POI to select and bold the entire worksheet
•
Java
I am a beginner of Apache POI library
In VBA, I know I can use the following code to select and bold the entire worksheet
Dim ws As Worksheet Set ws = ThisWorkbook.Sheets(1) ws.Cells.Font.Bold = True
Can I know how to select and bold the entire table by coding using the Apache POI library?
thank you
Solution
There is a good example of this link
Sheet sheet = wb.createSheet("test"); CellStyle cs = wb.createCellStyle(); Font f = wb.createFont(); f.setBoldweight(Font.BOLDWEIGHT_BOLD); cs.setFont(f); sheet.setDefaultColumnStyle(1,cs); //set bold for column 1
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码