This commit is contained in:
caozehui
2025-07-15 13:48:32 +08:00
parent 41e11c0a99
commit 2454d84919

View File

@@ -158,13 +158,11 @@ public class ExcelUtil {
//没有表格标题,只有表格头 //没有表格标题,只有表格头
for (int i = 0; i < headerRowNumber; i++) { for (int i = 0; i < headerRowNumber; i++) {
//获取列数 //获取列数
int physicalNumberOfCells = sheetAt.getRow(i).getPhysicalNumberOfCells();
//获取行
Row row = sheetAt.getRow(i); Row row = sheetAt.getRow(i);
if (Objects.isNull(row)) { if (Objects.isNull(row)) {
continue; continue;
} }
for (int j = 0; j < physicalNumberOfCells; j++) { for (int j = row.getFirstCellNum(); j < row.getLastCellNum(); j++) {
//获取单元格对象 //获取单元格对象
Cell cell = row.getCell(j); Cell cell = row.getCell(j);
//获取单元格样式对象 //获取单元格样式对象