Acme-CPANModules-HTMLTable

 view release on metacpan or  search on metacpan

lib/Acme/CPANModules/HTMLTable.pm  view on Meta::CPAN

package Acme::CPANModules::HTMLTable;

use 5.010001;
use strict;
use warnings;
#use utf8;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2023-10-29'; # DATE
our $DIST = 'Acme-CPANModules-HTMLTable'; # DIST
our $VERSION = '0.002'; # VERSION

sub _make_table {
    my ($cols, $rows, $celltext) = @_;
    my $res = [];
    push @$res, [];
    for (0..$cols-1) { $res->[0][$_] = "col" . ($_+1) }
    for my $row (1..$rows) {
        push @$res, [ map { $celltext // "row$row.$_" } 1..$cols ];
    }
    $res;
}

our $LIST = {
    summary => 'List of modules that generate HTML tables',
    entry_features => {
    },
    entries => [
        {
            module => 'Text::Table::Any',
            description => <<'_',

This is a common frontend for many text table modules as backends,
L<Text::Table::HTML> being one.

_
            bench_code => sub {
                my ($table) = @_;
                Text::Table::Any::table(rows=>$table, header_row=>1, backend=>'Text::Table::HTML');
            },
            features => {
            },
        },

        {
            module => 'Text::Table::HTML',
            bench_code => sub {
                my ($table) = @_;
                Text::Table::HTML::table(rows=>$table, header_row=>1);
            },
            features => {
            },
        },

        {
            module => 'Text::Table::HTML::DataTables',
            bench_code => sub {
                my ($table) = @_;
                Text::Table::HTML::DataTables::table(rows=>$table, header_row=>1);
            },
            features => {
            },
        },

        {
            module => 'Text::Table::Manifold',



( run in 2.218 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )