.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Text::FormatTable 3pm" .TH Text::FormatTable 3pm "2021-01-05" "perl v5.32.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::FormatTable \- Format text tables .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 5 \& my $table = Text::FormatTable\->new(\*(Aqr|l\*(Aq); \& $table\->head(\*(Aqa\*(Aq, \*(Aqb\*(Aq); \& $table\->rule(\*(Aq=\*(Aq); \& $table\->row(\*(Aqc\*(Aq, \*(Aqd\*(Aq); \& print $table\->render(20); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Text::FormatTable renders simple tables as text. You pass to the constructor (\fInew\fR) a table format specification similar to LaTeX (e.g. \f(CW\*(C`r|l|5l|R|20L\*(C'\fR) and you call methods to fill the table data and insert rules. After the data is filled, you call the \fIrender\fR method and the table gets formatted as text. .PP Methods: .IP "\fBnew\fR(\fI\f(CI$format\fI\fR)" 4 .IX Item "new($format)" Create a Text::FormatTable object, the format of each column is specified as a character of the \f(CW$format\fR string. The following formats are defined: .RS 4 .IP "l" 4 .IX Item "l" Left-justified top aligned word-wrapped text. .IP "L" 4 .IX Item "L" Left-justified bottom aligned word-wrapped text. .IP "r" 4 .IX Item "r" Right-justified top aligned word-wrapped text. .IP "R" 4 .IX Item "R" Right-justified bottom aligned word-wrapped text. .IP "10R, 20r, 15L, 12l," 4 .IX Item "10R, 20r, 15L, 12l," Number is fixed width of the column. Justified and aligned word-wrapped text (see above). .IP "' '" 4 A space. .IP "|" 4 Column separator. .RE .RS 4 .RE .IP "\fBhead\fR(\fI\f(CI$col1\fI\fR, \fI\f(CI$col2\fI\fR, ...)" 4 .IX Item "head($col1, $col2, ...)" Add a header row using \f(CW$col1\fR, \f(CW$col2\fR, etc. as cell contents. Note that, at the moment, header rows are treated like normal rows. .IP "\fBrow\fR(\fI\f(CI$col1\fI\fR, \fI\f(CI$col2\fI\fR, ...)" 4 .IX Item "row($col1, $col2, ...)" Add a row with \f(CW$col1\fR, \f(CW$col2\fR, etc. as cell contents. .IP "\fBrule\fR([\fI\f(CI$char\fI\fR])" 4 .IX Item "rule([$char])" Add an horizontal rule. If \f(CW$char\fR is specified it will be used as character to draw the rule, otherwise '\-' will be used. .IP "\fBrender\fR([\fI\f(CI$screen_width\fI\fR])" 4 .IX Item "render([$screen_width])" Return the rendered table formatted with \f(CW$screen_width\fR or 79 if it is not specified. .SH "SEE ALSO" .IX Header "SEE ALSO" Text::ASCIITable .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2001\-2004 Swiss Federal Institute of Technology, Zurich. (c) 2009 Trey Harris All Rights Reserved. .PP This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "CODE REPOSITORY" .IX Header "CODE REPOSITORY" Git \- http://github.com/treyharris/Text\-FormatTable/tree/master .SH "AUTHOR" .IX Header "AUTHOR" David Schweikert  .PP Maintained by Trey Harris  .PP Fixed column width and bottom alignment written by Veselin Slavov