.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Text::SimpleTable::AutoWidth 3pm" .TH Text::SimpleTable::AutoWidth 3pm "2017-09-08" "perl v5.26.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Text::SimpleTable::AutoWidth \- Text::SimpleTable::AutoWidth \- Simple eyecandy ASCII tables with auto\-width selection .SH "VERSION" .IX Header "VERSION" version 0.09 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Text::SimpleTable::AutoWidth; \& \& my $t1 = Text::SimpleTable::AutoWidth\->new(); \& $t1\->row( \*(Aqfoobarbaz\*(Aq, \*(Aqyadayadayada\*(Aq ); \& print $t1\->draw; \& \& .\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-. \& | foobarbaz | yadayadayada | \& \*(Aq\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq \& \& \& my $t2 = Text::SimpleTable::AutoWidth\->new(); \& $t2\->captions( \*(AqFoo\*(Aq, \*(AqBar\*(Aq ); \& $t2\->row( \*(Aqfoobarbaz\*(Aq, \*(Aqyadayadayada\*(Aq ); \& $t2\->row( \*(Aqbarbarbarbarbar\*(Aq, \*(Aqyada\*(Aq ); \& print $t2\->draw; \& \& .\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-. \& | Foo | Bar | \& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ \& | foobarbaz | yadayadayada | \& | barbarbarbarbar | yada | \& \*(Aq\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Simple eyecandy \s-1ASCII\s0 tables with auto-selection columns width, as seen in Catalyst. .SH "METHODS" .IX Header "METHODS" .SS "new(@attrs)" .IX Subsection "new(@attrs)" Inherited constructor from Moo. You can set following attributes: .PP \fIfixed_width\fR .IX Subsection "fixed_width" .PP Set fixed width for resulting table. By default it's 0, that's mean \*(L"don't fix width\*(R", so width of result table will depend on input data. .PP Be warned, that fixed_width will include not only width of your data, but also all surronding characters, like spaces across values, table drawings (like '|') and hypen (if wrapping is needed). .PP \fImax_width\fR .IX Subsection "max_width" .PP Set maximum width for resulting table. By default it's 0, that's mean \*(L"use default value\*(R". Default value is stored in \&\f(CW$Text::SimpleTable::AutoWidth::WIDTH_LIMIT\fR, and can be changed at any moment. Default value for \s-1WIDTH_LIMIT\s0 is 200. .PP Be warned, that max_width will include not only width of your data, but also all surronding characters, like spaces across values, table drawings (like '|') and hypen (if wrapping is needed). .PP \&\s-1NB:\s0 if you set fixed_width and max_width at same time, then you'll get table with fixed width, but not wider than max_width characters. .PP \fIcaptions\fR .IX Subsection "captions" .PP ArrayRef[Str] for captions in resulting table. .PP \fIrows\fR .IX Subsection "rows" .PP ArrayRef[ArrayRef[Str]] for values in each row. You can use next method to add individual rows into table. .SS "row(@texts)" .IX Subsection "row(@texts)" Add new row to table. Return \f(CW$self\fR, so you can write something like this: .PP .Vb 6 \& print Text::SimpleTable::AutoWidth \& \->new( max_width => 55, captions => [qw/ Name Age /] ) \& \->row( \*(AqMother\*(Aq, 59 ) \& \->row( \*(AqDad\*(Aq, 58 ) \& \->row( \*(Aqme\*(Aq, 32 ) \& \->draw(); .Ve .SS "\fIdraw()\fP" .IX Subsection "draw()" Draw table. Really, just calculate column width, and then call Text::SimpleTable\->\fIdraw()\fR. .SH "GIT REPOSITORY" .IX Header "GIT REPOSITORY" git clone git://github.com/cub\-uanic/Text\-SimpleTable\-AutoWidth.git .SH "SEE ALSO" .IX Header "SEE ALSO" Text::SimpleTable, Moo, Catalyst .SH "AUTHOR" .IX Header "AUTHOR" Oleg Kostyuk, \f(CW\*(C`\*(C'\fR .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright by Oleg Kostyuk. .PP This program is free software; you can redistribute it and/or modify it under the terms of either: the \s-1GNU\s0 General Public License as published by the Free Software Foundation; or the Artistic License. .PP See http://dev.perl.org/licenses/ for more information. .SH "AUTHOR" .IX Header "AUTHOR" Oleg Kostyuk .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2015 by Oleg Kostyuk. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.