@@ -692,6 +692,7 @@ protected function loadSpreadsheetFromFile(string $filename): Spreadsheet
692
692
$ this ->styleReader ->setNamespace ($ mainNS );
693
693
$ this ->styleReader ->setStyleBaseData ($ theme , $ styles , $ cellStyles );
694
694
$ dxfs = $ this ->styleReader ->dxfs ($ this ->readDataOnly );
695
+ $ tableStyles = $ this ->styleReader ->tableStyles ($ this ->readDataOnly );
695
696
$ styles = $ this ->styleReader ->styles ();
696
697
697
698
// Read content after setting the styles
@@ -1000,7 +1001,7 @@ protected function loadSpreadsheetFromFile(string $filename): Spreadsheet
1000
1001
$ this ->readBackgroundImage ($ xmlSheetNS , $ docSheet , dirname ("$ dir/ $ fileWorksheet " ) . '/_rels/ ' . basename ($ fileWorksheet ) . '.rels ' );
1001
1002
}
1002
1003
1003
- $ this ->readTables ($ xmlSheetNS , $ docSheet , $ dir , $ fileWorksheet , $ zip , $ mainNS );
1004
+ $ this ->readTables ($ xmlSheetNS , $ docSheet , $ dir , $ fileWorksheet , $ zip , $ mainNS, $ tableStyles , $ dxfs );
1004
1005
1005
1006
if ($ xmlSheetNS && $ xmlSheetNS ->mergeCells && $ xmlSheetNS ->mergeCells ->mergeCell && !$ this ->readDataOnly ) {
1006
1007
foreach ($ xmlSheetNS ->mergeCells ->mergeCell as $ mergeCellx ) {
@@ -2311,12 +2312,14 @@ private function readTables(
2311
2312
string $ dir ,
2312
2313
string $ fileWorksheet ,
2313
2314
ZipArchive $ zip ,
2314
- string $ namespaceTable
2315
+ string $ namespaceTable ,
2316
+ array $ tableStyles ,
2317
+ array $ dxfs
2315
2318
): void {
2316
2319
if ($ xmlSheet && $ xmlSheet ->tableParts ) {
2317
2320
$ attributes = $ xmlSheet ->tableParts ->attributes () ?? ['count ' => 0 ];
2318
2321
if (((int ) $ attributes ['count ' ]) > 0 ) {
2319
- $ this ->readTablesInTablesFile ($ xmlSheet , $ dir , $ fileWorksheet , $ zip , $ docSheet , $ namespaceTable );
2322
+ $ this ->readTablesInTablesFile ($ xmlSheet , $ dir , $ fileWorksheet , $ zip , $ docSheet , $ namespaceTable, $ tableStyles , $ dxfs );
2320
2323
}
2321
2324
}
2322
2325
}
@@ -2327,7 +2330,9 @@ private function readTablesInTablesFile(
2327
2330
string $ fileWorksheet ,
2328
2331
ZipArchive $ zip ,
2329
2332
Worksheet $ docSheet ,
2330
- string $ namespaceTable
2333
+ string $ namespaceTable ,
2334
+ array $ tableStyles ,
2335
+ array $ dxfs
2331
2336
): void {
2332
2337
foreach ($ xmlSheet ->tableParts ->tablePart as $ tablePart ) {
2333
2338
$ relation = self ::getAttributes ($ tablePart , Namespaces::SCHEMA_OFFICE_DOCUMENT );
@@ -2346,7 +2351,7 @@ private function readTablesInTablesFile(
2346
2351
2347
2352
if ($ this ->fileExistsInArchive ($ this ->zip , $ relationshipFilePath )) {
2348
2353
$ tableXml = $ this ->loadZip ($ relationshipFilePath , $ namespaceTable );
2349
- (new TableReader ($ docSheet , $ tableXml ))->load ();
2354
+ (new TableReader ($ docSheet , $ tableXml ))->load ($ tableStyles , $ dxfs );
2350
2355
}
2351
2356
}
2352
2357
}
0 commit comments