Skip to content

Commit 13d24de

Browse files
committed
update #285
1 parent ad8f711 commit 13d24de

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

renderer/blueprint.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,22 @@ func (f *Blueprint) renderLine(ctx tw.Formatting) {
523523

524524
isTotalPattern := false
525525

526+
// Case-insensitive check for "total"
527+
if isHMergeStart && colIndex > 0 {
528+
if prevCellCtx, ok := ctx.Row.Current[colIndex-1]; ok {
529+
if strings.Contains(strings.ToLower(prevCellCtx.Data), "total") {
530+
isTotalPattern = true
531+
f.logger.Debugf("renderLine: total pattern in row in %d", colIndex)
532+
}
533+
}
534+
}
535+
536+
// Get the alignment from the configuration
537+
align = cellCtx.Align
538+
526539
// Override alignment for footer merged cells
527540
if (ctx.Row.Position == tw.Footer && isHMergeStart) || isTotalPattern {
528-
if align != tw.AlignRight {
541+
if align == tw.AlignNone {
529542
f.logger.Debugf("renderLine: Applying AlignRight HMerge/TOTAL override for Footer col %d. Original/default align was: %s", colIndex, align)
530543
align = tw.AlignRight
531544
}

0 commit comments

Comments
 (0)