Skip to content

Commit

Permalink
Allow for Color formating on Merged Cells
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Nobuhara committed Feb 13, 2019
1 parent e6d60cf commit 2086035
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions table.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,11 @@ func (t *Table) printRowMergeCells(writer io.Writer, columns [][]string, rowIdx
// Pad Each Height
pads := []int{}

// Checking for ANSI escape sequences for columns
is_esc_seq := false
if len(t.columnsParams) > 0 {
is_esc_seq = true
}
for i, line := range columns {
length := len(line)
pad := max - length
Expand All @@ -727,6 +732,11 @@ func (t *Table) printRowMergeCells(writer io.Writer, columns [][]string, rowIdx

str := columns[y][x]

// Embedding escape sequence with column value
if is_esc_seq {
str = format(str, t.columnsParams[y])
}

if t.autoMergeCells {
//Store the full line to merge mutli-lines cells
fullLine := strings.Join(columns[y], " ")
Expand Down

0 comments on commit 2086035

Please sign in to comment.