Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Text::Table::Any(3)   User Contributed Perl Documentation  Text::Table::Any(3)

NAME
       Text::Table::Any	- Generate text	table using one	of several backends

VERSION
       This document describes version 0.097 of	Text::Table::Any (from Perl
       distribution Text-Table-Any), released on 2020-06-11.

SYNOPSIS
	use Text::Table::Any;

	my $rows = [
	    # header row
	    ['Name', 'Rank', 'Serial'],
	    # rows
	    ['alice', 'pvt', '123456'],
	    ['bob',   'cpl', '98765321'],
	    ['carol', 'brig gen', '8745'],
	];
	print Text::Table::Any::table(rows => $rows, header_row	=> 1,
				      backend => 'Text::Table::Tiny');

DESCRIPTION
       This module provides a single function, "table",	which formats a	two-
       dimensional array of data as text table,	using one of several available
       backends. The interface is modelled after Text::Table::Tiny (0.03);
       Text::Table::Tiny also happens to be the	default	backend.

       The example shown in the	SYNOPSIS generates the following table:

	+-------+----------+----------+
	| Name	| Rank	   | Serial   |
	+-------+----------+----------+
	| alice	| pvt	   | 123456   |
	| bob	| cpl	   | 98765321 |
	| carol	| brig gen | 8745     |
	+-------+----------+----------+

       When using "Text::Table::Org" backend, the result is something like:

	| Name	| Rank	   | Serial   |
	|-------+----------+----------|
	| alice	| pvt	   | 123456   |
	| bob	| cpl	   | 98765321 |
	| carol	| brig gen | 8745     |

       When using "Text::Table::CSV" backend:

	"Name","Rank","Serial"
	"alice","pvt","123456"
	"bob","cpl","98765321"
	"carol","brig gen","8745"

       When using "Text::ANSITable" backend:

	.-------+----------+----------.
	| Name	| Rank	   |   Serial |
	+-------+----------+----------+
	| alice	| pvt	   |   123456 |
	| bob	| cpl	   | 98765321 |
	| carol	| brig gen |	 8745 |
	`-------+----------+----------'

       When using "Text::ASCIITable" backend:

	.-----------------------------.
	| Name	| Rank	   | Serial   |
	+-------+----------+----------+
	| alice	| pvt	   |   123456 |
	| bob	| cpl	   | 98765321 |
	| carol	| brig gen |	 8745 |
	'-------+----------+----------'

       When using "Text::FormatTable" backend:

	Name |Rank    |Serial
	alice|pvt     |123456
	bob  |cpl     |98765321
	carol|brig gen|8745

       When using "Text::MarkdownTable"	backend:

	| Name	| Rank	   | Serial   |
	|-------|----------|----------|
	| alice	| pvt	   | 123456   |
	| bob	| cpl	   | 98765321 |
	| carol	| brig gen | 8745     |

       When using "Text::Table"	backend:

	Name  Rank     Serial
	alice pvt	 123456
	bob   cpl      98765321
	carol brig gen	   8745

       When using "Text::TabularDisplay" backend:

	+-------+----------+----------+
	| Name	| Rank	   | Serial   |
	+-------+----------+----------+
	| alice	| pvt	   | 123456   |
	| bob	| cpl	   | 98765321 |
	| carol	| brig gen | 8745     |
	+-------+----------+----------+

VARIABLES
   @BACKENDS
       List of supported backends.

FUNCTIONS
   table
       Usage:

	table(%params) => str

       Known arguments:

       o   rows	(aoaos)

	   Required. Takes an array reference which should contain one or more
	   rows	of data, where each row	is an array reference.

       o   backend (str, default "Text::Table::Tiny")

	   Optional. Pick a backend module. Supported backends:

	   o   Text::Table::Tiny

	   o   Text::Table::TinyBorderStyle

	   o   Text::Table::TinyColor

	   o   Text::Table::TinyColorWide

	   o   Text::Table::TinyWide

	   o   Text::Table::Org

	   o   Text::Table::CSV

	   o   Text::Table::TSV

	   o   Text::Table::LTSV

	   o   Text::Table::ASV

	   o   Text::Table::HTML

	   o   Text::Table::HTML::DataTables

	   o   Text::Table::Paragraph

	   o   Text::ANSITable

	   o   Text::ASCIITable

	   o   Text::FormatTable

	   o   Text::MarkdownTable

	   o   Text::Table

	   o   Text::TabularDisplay

	   o   Text::Table::XLSX

	   o   Term::TablePrint

       o   header_row (bool, default 0)

	   Optional. If	given a	true value, the	first row in the data will be
	   interpreted as a header row,	and separated visually from the	rest
	   of the table	(e.g. with a ruled line). But some backends won't
	   display differently.

   backends
       Return list of supported	backends. You can also get the list from the
       "@BACKENDS" package variable.

HOMEPAGE
       Please visit the	project's homepage at
       <https://metacpan.org/release/Text-Table-Any>.

SOURCE
       Source repository is at
       <https://github.com/perlancar/perl-Text-Table-Any>.

BUGS
       Please report any bugs or feature requests on the bugtracker website
       <https://rt.cpan.org/Public/Dist/Display.html?Name=Text-Table-Any>

       When submitting a bug or	request, please	include	a test-file or a patch
       to an existing test-file	that illustrates the bug or desired feature.

SEE ALSO
       Bencher::Scenario::TextTableModules

AUTHOR
       perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE
       This software is	copyright (c) 2020, 2019, 2018,	2017, 2016, 2015 by
       perlancar@cpan.org.

       This is free software; you can redistribute it and/or modify it under
       the same	terms as the Perl 5 programming	language system	itself.

perl v5.32.0			  2020-06-11		   Text::Table::Any(3)

NAME | VERSION | SYNOPSIS | DESCRIPTION | VARIABLES | FUNCTIONS | HOMEPAGE | SOURCE | BUGS | SEE ALSO | AUTHOR | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Text::Table::Any&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help