正在显示
1 个修改的文件
包含
3 行增加
和
0 行删除
| @@ -848,6 +848,9 @@ public class ExcelUtil<T> | @@ -848,6 +848,9 @@ public class ExcelUtil<T> | ||
| 848 | headerFont.setBold(true); | 848 | headerFont.setBold(true); |
| 849 | headerFont.setColor(excel.headerColor().index); | 849 | headerFont.setColor(excel.headerColor().index); |
| 850 | style.setFont(headerFont); | 850 | style.setFont(headerFont); |
| 851 | + // 设置表格头单元格文本形式 | ||
| 852 | + DataFormat dataFormat = wb.createDataFormat(); | ||
| 853 | + style.setDataFormat(dataFormat.getFormat("@")); | ||
| 851 | headerStyles.put(key, style); | 854 | headerStyles.put(key, style); |
| 852 | } | 855 | } |
| 853 | } | 856 | } |
-
请 注册 或 登录 后发表评论