..######.#####.##...##.######...######...#....#####..##....#####..
....##...##.....##.##....##.......##....###...##..##.##....##.....
....##...##......###.....##.......##...##.##..##..##.##....##.....
....##...####.....#......##.......##..##...##.#####..##....####...
....##...##......###.....##.......##..#######.##..##.##....##.....
....##...##.....##.##....##.......##..##...##.##..##.##....##.....
....##...#####.##...##...##.......##..##...##.#####..#####.#####..
Fast and flexible PHP library for text tables.
There's also a Python version of this library.
- Production ready,
- Easy to use,
- No additional dependencies,
- Documented.
$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.
- Written and copyrighted ©2022-2023 by Marcin Orlowski <mail (#) marcinorlowski (.) com>
- Text Table is open-sourced software licensed under the MIT license