tabular 0.1.0

Text-based table generator.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

Tabular

A simple text-based table generator.

import tabular;
import std.stdio;

void main() {
    string[][] data = [
        ["name", "age", "profession"],
        ["Andrew", "15", "blacksmith"],
        ["John", "25", "carpenter"]
    ];
    // Use the TableBuilder
    string myTable = new TableBuilder().withData(data).build();
    writeln(myTable);
    // Or use a simplified function call
    writeln(renderTable(myTable));
    /* Output:
    +--------+-----+------------+
    | name   | age | profession |
    +--------+-----+------------+
    | Andrew | 15  | blacksmith |
    +--------+-----+------------+
    | John   | 25  | carpenter  |
    +--------+-----+------------+
    */
}

Features

  • Dynamic table sizes based on content.
  • Text-alignment.
  • Optional borders (on by default).
Authors:
  • Andrew Lalis
Dependencies:
none
Versions:
0.1.0 2022-Aug-15
~main 2022-Oct-10
Show all 2 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 6 downloads total

Score:
0.4
Short URL:
tabular.dub.pm