XML::Filter::TableWrapper - Wrap a table's cells in to a certain number of rows
use XML::Filter::TableWrapper; use XML::SAX::Machines qw( Pipeline ); ## Ouput a table with 5 rows, the last row having 3 cells: Pipeline( XML::Filter::TableWrapper->new( Columns => 3, # The default is 5 ), \*STDOUT, )->parse_string( "<table>" . "<td/>" x 23 . "</table" );
Takes a list of elements and inserts (by default) <tr>...</tr> elements to make an table with a specified number of columns (5 by default). By default, it assumes that the container element is named "{}table" (the "{}" means it is not namespaced), but this can be changed:
<tr>...</tr>
XML::Filter::TableWrapper->new( ListTags => "{$my_ns}rows", Columns => 3, );
for instance.
These can be read as possible future features:
Be able to translate the container tag to some other, for instance:
ListTags => { "{}ul" => { TableTag => "{}table", RowTag => "{}tr", CellTag => "{}td", }, }
Autoadapt if the user specifies empty "{}" namespaces and the events have no NamespaceURI defined, and vice versa.
Row filling instead of column filling.
Stripping of existing row tags, for "refilling" a table.
Callbacks to allow the various tags to be built, so they can have attributes. This would be a decent way of allowing greybar, for instance.
$h->Columns( 1024 ); my $columns = $h->Columns;
Set/get the number of columns to wrap to.
1 POD Error
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
=over without closing =back
To install XML::Filter::TableWrapper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Filter::TableWrapper
CPAN shell
perl -MCPAN -e shell install XML::Filter::TableWrapper
For more information on module installation, please visit the detailed CPAN module installation guide.