infinitered / gluegun

A delightful toolkit for building TypeScript-powered command-line apps.
MIT License
2.95k stars 147 forks source link

support for passing style option to print.table #724

Open Faizahmadfaiz opened 4 years ago

Faizahmadfaiz commented 4 years ago

Hey guys, I want to print a table in which I want some of my column cells to be right aligned. Going through cli-table3 (which is used by gluegun) examples, I found this

var table = new Table({
  chars: { 'top': '' , 'top-mid': '' , 'top-left': '' , 'top-right': ''
         , 'bottom': '' , 'bottom-mid': '' , 'bottom-left': '' , 'bottom-right': ''
         , 'left': '' , 'left-mid': '' , 'mid': '' , 'mid-mid': ''
         , 'right': '' , 'right-mid': '' , 'middle': ' ' },
  style: { 'padding-left': 0, 'padding-right': 0 }
});

Currently in table function I can see we can pass only data: string[][], options: GluegunPrintTableOptions = {} .It seems to me currently I can't achive my goal of making cells right aligned.

jamonholmgren commented 3 years ago

@Faizahmadfaiz I'd accept a PR that adds it to GluegunPrintTableOptions!