엑셀 헤더 스타일 추가

main
이범준 4 months ago
parent 87b3839fe7
commit d0965d1c84

@ -0,0 +1,24 @@
package cokr.xit.applib.xls;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
public class StyleMaker {
public static Style headerStyle(XLSWriter xlsx) {
return new Style()
.foregroundColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex())
.configure(styl -> {
Font font = xlsx.workbook().createFont();
font.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
styl.font(font);
styl.alignment(HorizontalAlignment.CENTER);
});
}
}
Loading…
Cancel
Save