in reply to How to use cgi table in newindex.pm perl

You could use Spreadsheet::HTML by jeffa:

perl -E' use strict; use warnings; use Data::Dumper; use Spreadsheet::HTML; my $href = { Adam => "Eve", Clyde => "Bonnie" }; my @data = ( [qw/Man Woman/], map { [$_, $href->{ $_ }] } keys %{ $hre +f } ); my $make = Spreadsheet::HTML->new( data => \@data ); my $html = $make->portrait; say $html; ' <table><tr><th>Man</th><th>Woman</th></tr><tr><td>Adam</td><td>Eve</td +></tr><tr><td>Clyde</td><td>Bonnie</td></tr></table>

But honestly your best bet is to use a web application framework like Dancer2, and have your route return JSON to a frontend table builder, e.g. DataTables.

Hope this helps!



The way forward always starts with a minimal test.