marcin-orlowski / text-table
Fast and flexible PHP library for text tables.
Installs: 4 989
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 1
Open Issues: 1
Requires
- php: ^8.1
- ext-mbstring: *
- marcin-orlowski/lombok-php: ^1.0
Requires (Dev)
- marcin-orlowski/lockpick: ^1.2
- marcin-orlowski/phpunit-extra-asserts: ^5.0
- phpstan/phpstan: ^1.8
- phpunit/phpunit: ^10.3
README
..######.#####.##...##.######...######...#....#####..##....#####..
....##...##.....##.##....##.......##....###...##..##.##....##.....
....##...##......###.....##.......##...##.##..##..##.##....##.....
....##...####.....#......##.......##..##...##.#####..##....####...
....##...##......###.....##.......##..#######.##..##.##....##.....
....##...##.....##.##....##.......##..##...##.##..##.##....##.....
....##...#####.##...##...##.......##..##...##.#####..#####.#####..
Fast and flexible PHP library for text tables.
There's also a Python version of this library.
Features
- Production ready,
- Easy to use,
- No additional dependencies,
- 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:
┌────┬───────┬───────┐ │ ID │ NAME │ SCORE │ ├────┼───────┼───────┤ │ 1 │ John │ 12 │ │ 2 │ Tommy │ 15 │ └────┴───────┴───────┘
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