« ColorTheme/Text/ANSITable/Standard/GradationWhiteBG.pm
↑ Summary
BorderStyle/Text/ANSITable/OldCompat/Default/bold.pm »
| 1 | #!perl | ||
| 2 | |||
| 3 | use 5.010; | ||
| 4 | use Text::ANSITable; | ||
| 5 | |||
| 6 | # don't forget this if you want to output utf8 characters | ||
| 7 | binmode(STDOUT, ":utf8"); | ||
| 8 | |||
| 9 | my $t = Text::ANSITable->new; | ||
| 10 | |||
| 11 | # set styles | ||
| 12 | #$t->border_style('UTF8::SingleLineBold'); # if not, a nice default is picked | ||
| 13 | $t->color_theme('Standard::NoGradation'); # if not, a nice default is picked | ||
| 14 | |||
| 15 | # fill data | ||
| 16 | $t->columns(["name" , "color" , "price"]); | ||
| 17 | $t->add_row(["chiki" , "yellow", 2000]); | ||
| 18 | $t->add_row(["lays" , "green" , 7000]); | ||
| 19 | $t->add_row(["tao kae noi", "blue" , 18500]); | ||
| 20 | |||
| 21 | # draw it! | ||
| 22 | print "Set BORDER_STYLE to customize border style\n"; | ||
| 23 | print $t->draw; |