|
NAMEText::UnicodeBox::Table - High level interface providing easy table drawing SYNOPSIS my $table = Text::UnicodeBox::Table->new();
$table->add_header('id', 'name');
$table->add_row('1', 'George Washington');
$table->add_row('2', 'Thomas Jefferson');
print $table->render();
# Prints:
# ┌────┬───────────────────┐
# │ id │ name │
# ├────┼───────────────────┤
# │ 1 │ George Washington │
# │ 2 │ Thomas Jefferson │
# └────┴───────────────────┘
DESCRIPTIONThis module provides an easy high level interface over Text::UnicodeBox. METHODSnewPass any arguments you would to "new" in Text::UnicodeBox but with the following additions.
add_header ( [\%opt,] @parts ) $table->add_header({ bottom => 'heavy' }, 'Name', 'Age', 'Address');
Same as "add_row" but sets the option ('header' => 1) Draws one line of output with a border on the top and bottom. add_row ( [\%opt,] @parts )If the first argument to this method is a hashref, it is interpreted as an options hash. This hash takes the following parameters:
output_widthReturns the width of the table if it were rendered right now without additional rows added. COPYRIGHTCopyright (c) 2012 Eric Waters and Shutterstock Images (http://shutterstock.com). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. AUTHOREric Waters <ewaters@gmail.com>
|