columnify
columnify copied to clipboard
paddingChr per column?
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?