columnify icon indicating copy to clipboard operation
columnify copied to clipboard

paddingChr per column?

Open dland512 opened this issue 6 years ago • 0 comments

Is is possible to use different padding characters for difference columns or use a padding character for one column and not another? I have this code:

const qa = [
    {
        question: 'How are you?',
        answer: 'I am fine'
    },
    {
        question: 'Are you sure?',
        answer: 'Yes'
    },
    {
        question: 'Are you sure you\'re sure?',
        answer: ''
    }
];
    
console.log(columnify(qa, { showHeaders: false, paddingChr: '.' }));

What I'm getting is this:

How are you?............. I am fine
Are you sure?............ Yes......
Are you sure you're sure? .........

I only want dots leading from the questions to the answers, not after the answers, like this:

How are you?............. I am fine
Are you sure?............ Yes
Are you sure you're sure? 

dland512 avatar Mar 22 '19 16:03 dland512