Skip to content

Latest commit

 

History

History
64 lines (48 loc) · 2.07 KB

README.md

File metadata and controls

64 lines (48 loc) · 2.07 KB

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