Hi ! I want to bold entire row in Java. Could you help me ?
We recommend you to create your style object with your desired formatting and then apply to your specific rows/columns via using Row.applyStyle/Column.applyStyle() method. See the documents for your reference:
Also, see the sample code for your reference:
e.g
Sample code:
........
Worksheet sheet = workbook.getWorksheets().get(0);
Cells cells = sheet.getCells();
//Create and apply bold style to first row.
Style rowStyle = sheet.getCells().getRows().get(0).getStyle();
rowStyle.getFont().setBold(true);
StyleFlag rowStyleFlag = new StyleFlag();
rowStyleFlag.setFontBold(true);
sheet.getCells().getRows().get(0).applyStyle(rowStyle, rowStyleFlag);
.........
Hope, this helps a bit.
1 Like
Thanks a lot !
You are welcome. Feel free to write us back if you have further comments or questions, we will be happy to assist you soon.