Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 654 Bytes

README.md

File metadata and controls

36 lines (25 loc) · 654 Bytes

Formatter::Align

Easily format an array in an aligned table.

Usage:

use Formatter::Align;

my @headers = <<ID Name Type "Family Name">>;
my @data =
  (1, "George", "CEO", "Reagen"),
  (2, "Tami", "Employee", "?"),
  (3, "Kaaris", "CXO", "Rap");

# The headers are optional.
say format(@data, @headers);

Output:

 ID  Name    Type      Family Name 
 ==  ====    ====      =========== 
 1   George  CEO       Reagen      
 2   Tami    Employee  ?           
 3   Kaaris  CXO       Rap         

Options:

  • padding-from: The space at the beginning of a column.
  • padding-to: The space at the end of a column.