View on
MetaCPAN
Jeffrey Hayes Anderson > Spreadsheet-HTML > Spreadsheet::HTML

Download:
Spreadsheet-HTML-1.20.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: 1.20   Source  

NAME ^

Spreadsheet::HTML - Just another HTML table generator.

SYNOPSIS ^

Object oriented interface:

    use Spreadsheet::HTML;

    my @data = ( [qw(foo b&r b&z)], [1,2,3], [4,5,6], [7,8,9] );
    my $gen  = Spreadsheet::HTML->new( data => \@data, encode => 1 );

    print $gen->portrait( indent => '   ' );
    print $gen->landscape( indent => "\t" );

    $gen = Spreadsheet::HTML->new( file => 'data.xls', worksheet => 2 );
    print $gen->generate( preserve => 1 );

Procedural interface:

    use Spreadsheet::HTML qw( portrait landscape );

    print portrait( \@data, td => sub { sprintf "%02d", shift } );
    print landscape( \@data, tr => { class => [qw(odd even)] } );

DESCRIPTION ^

Generate HTML tables with ease (HTML4, XHTML and HTML5). Generate portrait, landscape and other rotated views, Handsontable tables, HTML calendars, checkerboard patterns, games such as sudoku, banners and mazes, and create animations of cell values and backgrounds via jQuery. Transform Excel, HTML, JSON, CSV, YAML, PNG, JPEG and GIF files instantly into HTML tables.

CLI TOOLS ^

METHODS ^

All methods (except new) are exportable as functions. They all accept the same named parameters (see PARAMETERS below). With the exception of new, all methods return an HTML table as a scalar string.

For most cases, portrait (headings at top) and landscape (headings at left) are all you need.

PARAMETERS ^

All methods/procedures accept the same named parameters. Some methods pre-define parameters on your behalf, for convenience. If these parameters are defined, they may be overriden where applicable. You do not necessarily have to specify data, any bare array references will be collected and assigned to data. Just because you can, however, does not mean you should. Everything is meant to be convenient.

LITERAL PARAMETERS

Literal parameters provides the means to modify the macro aspects of the table, such as indentation, encoding, data source and table orientation.

DYNAMIC PARAMETERS

Dynamic parameters provide a means to control the micro elements of the table, such as modifying headings by their name and rows and columns by their indices (X). They contain leading dashes to seperate them from literal and tag parameters.

TAG PARAMETERS

Tag parameters provide a means to control the attributes of the table's tags, and in the case of <th> and <td> the contents via callback subroutines. Although similar in form, they are differentiated from litertal parameters because they share the names of the actual HTML table tags.

PRESET METHODS ^

The following preset methods are availble for creating tables that can be used with little to no additional coding. All preset methods accept all of the above mentioned parameters (%params) in addition to those specific to themselves.

See Spreadsheet::HTML::Presets for more documentation (and source code for usage examples).

REQUIRES ^

OPTIONAL ^

The following is used to apply formulas to data:

The following are used to load data from various different file formats:

The following are used by some presets to enhance output, if installed:

SEE ALSO ^

BUGS AND LIMITATIONS ^

Please report any bugs or feature requests to either

I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Spreadsheet::HTML

The Github project is https://github.com/jeffa/Spreadsheet-HTML

You can also look for information at:

ACKNOWLEDGEMENTS ^

Thank you very much! :)

AUTHOR ^

Jeff Anderson, <jeffa at cpan.org>

LICENSE AND COPYRIGHT ^

Copyright 2017 Jeff Anderson.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0

Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.

If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.

This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.

This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.

Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

syntax highlighting: