Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jasperdunn opened this issue May 11, 2023 · 0 comments

Comments

@jasperdunn
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant