Skip to content

When using truncate, table borders are coloured the same as the cell content. #220

@jasperdunn

Description

@jasperdunn

Bug

When using truncate, table borders are getting coloured the same as the cell content.
Screenshot 2023-05-11 at 8 42 18 pm

How to replicate

let andTruncating = ''

for (let i = 0; i < 20; i++) {
  andTruncating += 'and truncating '
}

console.log(
  table(
    [
      ['test', 'using chalk to color cell data'],
      ['condition', chalk.red(andTruncating)],
    ],
    {
      columns: [
        {},
        {
          width: 50,
          truncate: 150,
        },
      ],
      columnDefault: {
        wrapWord: true,
      },
    }
  )
)

Removing truncate: 150, prints the table without the border changing color.
Screenshot 2023-05-11 at 8 42 34 pm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions