GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Text::MarkdownTable(3) User Contributed Perl Documentation Text::MarkdownTable(3)

Text::MarkdownTable - Write Markdown syntax tables from data

  my $table = Text::MarkdownTable->new;
  $table->add({one=>"a",two=>"table"});
  $table->add({one=>"is",two=>"nice"});
  $table->done;
  | one | two   |
  |-----|-------|
  | a   | table |
  | is  | nice  |
  Text::MarkdownTable->new( columns => ['X','Y','Z'], edges => 0 )
    ->add({a=>1,b=>2,c=>3})->done;
  X | Y | Z
  --|---|--
  1 | 2 | 3

This module can be used to write data in tabular form, formatted in MultiMarkdown syntax. The resulting format can be used for instance to display CSV data or to include data tables in Markdown files. Newlines and vertical bars in table cells are replaced by a space character and cell values can be truncated.

Filename, GLOB, scalar reference or IO::Handle to write to (default STDOUT).
Array, hash reference, or comma-separated list of fields/columns.
Column names. By default field names are used.
Column widths. By default column widths are calculated automatically to the width of the widest value. With given widths, the table is directly be written without buffering and large table cell values are truncated.
Include header lines. Enabled by default.
Include border before first column and after last column. Enabled by default. Note that single-column tables don't not look like tables if edges are disabled.
Write table unbuffered in condense format:

  one|two
  ---|---
  a|table
  is|nice
    

Note that single-column tables are don't look like tables on condense format.

Add a row as hash reference. Returns the table instance.
Returns whether rows are directly written or buffered until "done" is called.
Finish and write the table unless it has already been written in "streaming" mode.

See Catmandu::Exporter::Table for an application of this module that can be used to easily convert data to Markdown tables.

Similar table-generating modules include:

Jakob Voß <jakob.voss@gbv.de>

Copyright 2014- Jakob Voß

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2015-07-08 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.