@@ -480,10 +480,17 @@ protected static function parseCell($node, $element, &$styles)
480
480
if (!empty ($ beforespan )) {
481
481
$ cellRowContinue = array ('vMerge ' => 'continue ' );
482
482
$ beforecolspan = $ node ->getAttribute ('beforecolspan ' );
483
- if (!empty ($ beforecolspan )) {
484
- $ cellRowContinue ['gridSpan ' ] = $ beforecolspan ;
485
- }
483
+
486
484
for ($ s = 1 ; $ s <= $ beforespan ; $ s ++){
485
+ if (!empty ($ beforecolspan )) {
486
+ if (is_numeric ($ beforecolspan )) {
487
+ $ beforecolspan = (int ) $ beforecolspan ;
488
+ } else {
489
+ $ beforecolspans = json_decode ($ beforecolspan , true );
490
+ $ beforecolspan = $ beforecolspans [$ s - 1 ];
491
+ }
492
+ $ cellRowContinue ['gridSpan ' ] = $ beforecolspan ;
493
+ }
487
494
$ element ->addCell (null , $ cellRowContinue );
488
495
}
489
496
}
@@ -497,10 +504,17 @@ protected static function parseCell($node, $element, &$styles)
497
504
if (!empty ($ afterspan )) {
498
505
$ cellRowContinue = array ('vMerge ' => 'continue ' );
499
506
$ aftercolspan = $ node ->getAttribute ('aftercolspan ' );
500
- if ( ! empty ($ aftercolspan ) ) {
501
- $ cellRowContinue ['gridSpan ' ] = $ aftercolspan ;
502
- }
507
+
503
508
for ($ s = 1 ; $ s <= $ afterspan ; $ s ++) {
509
+ if (!empty ($ aftercolspan )) {
510
+ if (is_numeric ($ aftercolspan )) {
511
+ $ aftercolspan = (int ) $ aftercolspan ;
512
+ } else {
513
+ $ aftercolspans = json_decode ($ aftercolspan , true );
514
+ $ aftercolspan = $ aftercolspans [$ s - 1 ];
515
+ }
516
+ $ cellRowContinue ['gridSpan ' ] = $ aftercolspan ;
517
+ }
504
518
$ element ->addCell (null ,$ cellRowContinue );
505
519
}
506
520
}
0 commit comments