set ThymeleafExcelBuilder autoWidth
package com.github.liaochong.myexcel.core;
import com.github.liaochong.myexcel.core.io.TempFileOperator;
+import com.github.liaochong.myexcel.core.strategy.AutoWidthStrategy;
import com.github.liaochong.myexcel.exception.ExcelBuildException;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
@@ -54,6 +55,10 @@ public class ThymeleafExcelBuilder extends AbstractExcelBuilder {
TEMPLATE_ENGINE.setTemplateResolver(fileTemplateResolver);
}
+ public ThymeleafExcelBuilder() {
+ autoWidthStrategy(AutoWidthStrategy.AUTO_WIDTH);
+ }
+
@Override
public ExcelBuilder template(String path) {
Objects.requireNonNull(path);
