Skip to content

Feature rich, fast and flexible PHP library for rendering table data as nice text tables.

License

Notifications You must be signed in to change notification settings

MarcinOrlowski/php-text-table

Repository files navigation

Text Table

..######.#####.##...##.######...######...#....#####..##....#####..
....##...##.....##.##....##.......##....###...##..##.##....##.....
....##...##......###.....##.......##...##.##..##..##.##....##.....
....##...####.....#......##.......##..##...##.#####..##....####...
....##...##......###.....##.......##..#######.##..##.##....##.....
....##...##.....##.##....##.......##..##...##.##..##.##....##.....
....##...#####.##...##...##.......##..##...##.#####..#####.#####..

Fast and flexible PHP library for text tables.

Latest Stable Version Total Downloads License PHP Version Require

There's also a Python version of this library.


Features

  1. Production ready,
  2. Easy to use,
  3. No additional dependencies,
  4. Documented.

Usage examples

$table = new TextTable(['ID', 'NAME', 'SCORE']);
$table->addRows([
    [1, 'John', 12],
    [2, 'Tommy', 15],
]);
echo $table->renderAsString();

would produce nice text table:

┌────┬───────┬───────┐
│ IDNAMESCORE │
├────┼───────┼───────┤
│ 1John12    │
│ 2Tommy15    │
└────┴───────┴───────┘

Check docs for more usage examples.


License

  • Written and copyrighted ©2022-2023 by Marcin Orlowski <mail (#) marcinorlowski (.) com>
  • Text Table is open-sourced software licensed under the MIT license

About

Feature rich, fast and flexible PHP library for rendering table data as nice text tables.

Resources

License

Stars

Watchers

Forks

Languages