Skip to content
This repository has been archived by the owner on Jun 15, 2019. It is now read-only.

is there a way to set a background color for whitespaces? #33

Open
youssef06 opened this issue Jan 28, 2017 · 1 comment
Open

is there a way to set a background color for whitespaces? #33

youssef06 opened this issue Jan 28, 2017 · 1 comment

Comments

@youssef06
Copy link

youssef06 commented Jan 28, 2017

Is it possible to add a background color to a cli-table?
Currently if i add border color/bgColor i get something like this:
s

Edit
Here is the code for this example:

const Table = require('cli-table2');
const colors = require('colors');

let cliTable = new Table({
    head: [colors.black.bgWhite("header 1"), colors.black.bgWhite("header 2"), colors.black.bgWhite("header 3")],
    style: {
        border: ['cyan', 'bgWhite'],
        'padding-left': 1,
        'padding-right': 1,
        empty: ['bgWhite']
    }
});

cliTable.push([
    colors.black.bgWhite("val 11111111111111"), colors.black.bgWhite("val 12"), colors.black.bgWhite("val 13")
]);
cliTable.push([
    colors.black.bgWhite("val 21"), colors.black.bgWhite("val 2222222"), colors.black.bgWhite("val 23")
]);

console.log(cliTable.toString());

Is there a way to make the spaces have a certain background color?

If this is not possible can i make a PR for it?

@DavidBadura
Copy link

I need this feature too!

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

No branches or pull requests

2 participants