엑셀 헤더 스타일 추가
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…
Reference in New Issue