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

VERSION
    This document describes version 0.110 of Text::Table::Any (from Perl
    distribution Text-Table-Any), released on 2022-01-23.

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::More');

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::Sprintf is 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.

  %BACKEND_FEATURES
    List of features supported by each backend. Hash key is backend name,
    e.g. "Text::Table::Sprintf". Hash value is a hashref containing feature
    name as hashref key and a boolean value or other value as hashref value
    to describe the support of that feature by that backend.

FUNCTIONS
  table
    Usage:

     table(%params) => str

    Except for the "backend" parameter, the parameters will mostly be passed
    to the backend, sometimes slightly modified if necessary to achieve the
    desired effect. If a parameter is not supported by a backend, then it
    will not be passed to the backend.

    Known parameters:

    *   backend

        Optional. Str, default "Text::Table::Sprintf". Pick a backend
        module. Supported backends:

        *   Term::Table

        *   Term::TablePrint

        *   Text::ANSITable

        *   Text::ASCIITable

        *   Text::FormatTable

        *   Text::MarkdownTable

        *   Text::Table

        *   Text::Table::ASV

        *   Text::Table::CSV

        *   Text::Table::HTML

        *   Text::Table::HTML::DataTables

        *   Text::Table::LTSV

        *   Text::Table::Manifold

        *   Text::Table::More

        *   Text::Table::Org

        *   Text::Table::Paragraph

        *   Text::Table::Sprintf

        *   Text::Table::TSV

        *   Text::Table::TickitWidget

        *   Text::Table::Tiny

        *   Text::Table::TinyBorderStyle

        *   Text::Table::TinyColor

        *   Text::Table::TinyColorWide

        *   Text::Table::TinyWide

        *   Text::Table::XLSX

        *   Text::TabularDisplay

        *   Text::UnicodeBox::Table

        Support matrix for each backend:

         +-------------------------------+--------------+------------------------------------------------------------------------------------------------+------------+------+---------------+-------+
         | backend                       | backend_opts | backend_opts_note                                                                              | header_row | rows | separate_rows | title |
         +-------------------------------+--------------+------------------------------------------------------------------------------------------------+------------+------+---------------+-------+
         | Term::Table                   |              |                                                                                                | 1          | 1    | 0             | 0     |
         | Term::TablePrint              |              |                                                                                                | 1          | 1    | 0             | 0     |
         | Text::ANSITable               |              |                                                                                                | 1          | 1    | 1             | 0     |
         | Text::ASCIITable              |              |                                                                                                | 1          | 1    | 0             | 0     |
         | Text::FormatTable             |              |                                                                                                | 0          | 1    | 0             | 0     |
         | Text::MarkdownTable           |              |                                                                                                | 1          | 1    | 0             | 0     |
         | Text::Table                   |              |                                                                                                | 0          | 1    | 0             | 0     |
         | Text::Table::ASV              | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 1          | 1    | 0             | 0     |
         | Text::Table::CSV              | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 1          | 1    | 0             | 0     |
         | Text::Table::HTML             | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 1          | 1    | 0             | 1     |
         | Text::Table::HTML::DataTables | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 1          | 1    | 0             | 1     |
         | Text::Table::LTSV             | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 0          | 1    | 0             | 0     |
         | Text::Table::Manifold         |              |                                                                                                | 1          | 1    | 0             | 0     |
         | Text::Table::More             | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 1          | 1    | 1             | 0     |
         | Text::Table::Org              | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 1          | 1    | 1             | 0     |
         | Text::Table::Paragraph        | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 1          | 1    | 0             | 0     |
         | Text::Table::Sprintf          | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 1          | 1    | 1             | 0     |
         | Text::Table::TSV              | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 0          | 1    | 0             | 0     |
         | Text::Table::TickitWidget     | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 1          | 1    | 0             | 0     |
         | Text::Table::Tiny             | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 1          | 1    | 1             | 0     |
         | Text::Table::TinyBorderStyle  | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 1          | 1    | 1             | 0     |
         | Text::Table::TinyColor        | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 1          | 1    | 1             | 0     |
         | Text::Table::TinyColorWide    | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 1          | 1    | 1             | 0     |
         | Text::Table::TinyWide         | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 1          | 1    | 1             | 0     |
         | Text::Table::XLSX             | 1            | Backend-specific options (backend_opts) will be passed to table() or generate_table() directly | 1          | 1    | 0             | 0     |
         | Text::TabularDisplay          |              |                                                                                                | 0          | 1    | 0             | 0     |
         | Text::UnicodeBox::Table       |              |                                                                                                | 1          | 1    | 0             | 0     |
         +-------------------------------+--------------+------------------------------------------------------------------------------------------------+------------+------+---------------+-------+

    *   rows

        Required. Aoaos (array of array-of-scalars). Each element in the
        array is a row of data, where each row is an array reference.

    *   header_row

        Optional. Bool, default is false. 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.

    *   separate_rows

        Boolean. Optional. Default is false. If set to true, will draw a
        separator line after each data row.

        Not all backends support this.

    *   title

        Optional. Str. Title of the table.

        Currently the only backends supporting this are "Text::Table::HTML"
        and "Text::Table::HTML::DataTables".

    *   backend_opts

        Optional. Hashref. Pass backend-specific options to the backend
        module. Not all backend modules support this, but all backend
        modules that have interface following "Text::Table::Tiny" should
        support this. Also note that as the list of common options is
        expanded, a previously backend-specific option might be available
        later as a common option.

  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>.

SEE ALSO
    Acme::CPANModules::TextTable

AUTHOR
    perlancar <perlancar@cpan.org>

CONTRIBUTING
    To contribute, you can send patches by email/via RT, or send pull
    requests on GitHub.

    Most of the time, you don't need to build the distribution yourself. You
    can simply modify the code, then test via:

     % prove -l

    If you want to build the distribution (e.g. to try to install it locally
    on your system), you can install Dist::Zilla,
    Dist::Zilla::PluginBundle::Author::PERLANCAR, and sometimes one or two
    other Dist::Zilla plugin and/or Pod::Weaver::Plugin. Any additional
    steps required beyond that are considered a bug and can be reported to
    me.

COPYRIGHT AND LICENSE
    This software is copyright (c) 2022, 2020, 2019, 2018, 2017, 2016, 2015
    by perlancar <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.

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.

