PHPackages                             pgooch/php-ascii-tables - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. pgooch/php-ascii-tables

ActiveLibrary[CLI &amp; Console](/categories/cli)

pgooch/php-ascii-tables
=======================

Convert multi-dimensional arrays into ASCII Tabled, and vise-versa.

1.1.0(9y ago)364.2k12[1 PRs](https://github.com/pgooch/PHP-Ascii-Tables/pulls)1GPLv3PHPPHP &gt;=5.0.0

Since Sep 24Pushed 6y ago2 watchersCompare

[ Source](https://github.com/pgooch/PHP-Ascii-Tables)[ Packagist](https://packagist.org/packages/pgooch/php-ascii-tables)[ Docs](https://github.com/pgooch/PHP-Ascii-Tables)[ RSS](/packages/pgooch-php-ascii-tables/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (3)Used By (1)

PHP ASCII-Table
===============

[](#php-ascii-table)

This class will convert multi-dimensional arrays into ASCII Tables, and vice-versa.

### Setup &amp; Use

[](#setup--use)

Include `ascii_table.php` and call a new instance of the object. You can then call one of three functions:

- `make_Table($array, [$title], [$return], [$autoalign_cells])` will make a table with the multi-dimensional `$array` passed. Additionally you can specify an optional `$title` that will be centered on a line above the table. The `$return` variable gives you 3 options; `True` will return the table as an array, `False` will output the array directly, and a `String` will attempt to save the array in a text file with the given name/location and will return true/false upon completlion. If false the error message will be logged to the `$error` class variable. The parameter `$autoalign_cells`, if set to `True`, all columns containing only numeric datatypes will be aligned to the right of the cell.
- `break_Table($table)` Takes an table or a filename that containing a text file output from `make_table()` and will return a multi-dimensional array similar to the one that you would have given it `make_table()` to create it.
- `scrape_Table($table, $key, [$value])` will take a table or link to a file containing a table as `break_table()` does but will only return they key/value pairs you request. If you do not include the value it will use the key as the value and return it in a numeric array. It should be noted that if you use both key and value that muliple keys will overrite eachother and the returning array will only contain the last one in the table.

### Examples

[](#examples)

Examples of the classes functionality can be found in examples.php, and a text output can be found in `example.txt`. Table will be output or returned like this:

```
                                       Colors in Various Formats
+--------+---------+-----+-------+------+-----+------------+-----------+------+---------+--------+-----+
| color  | HEX     | Red | Green | Blue | Hue | Saturation | Lightness | Cyan | Magenta | Yellow | Key |
+--------+---------+-----+-------+------+-----+------------+-----------+------+---------+--------+-----+
| Red    | #FF0000 | 255 | 0     | 0    | 0   | 100        | 50        | 0    | 100     | 100    | 0   |
| Orange | #FFA500 | 255 | 165   | 0    | 39  | 100        | 50        | 0    | 100     | 35     | 0   |
| Yellow | #FFFF00 | 255 | 255   | 0    | 60  | 100        | 50        | 0    | 0       | 100    | 0   |
| Green  | #008000 | 0   | 128   | 0    | 120 | 100        | 25        | 100  | 0       | 100    | 50  |
| Blue   | #0000FF | 0   | 0     | 255  | 240 | 100        | 50        | 100  | 100     | 0      | 0   |
| Indigo | #4B0082 | 75  | 0     | 130  | 275 | 100        | 25        | 42   | 100     | 0      | 49  |
| Violet | #EE82EE | 238 | 130   | 238  | 300 | 76         | 72        | 0    | 45      | 0      | 7   |
+--------+---------+-----+-------+------+-----+------------+-----------+------+---------+--------+-----+

```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3523d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1129374?v=4)[Phillip Gooch](/maintainers/pgooch)[@pgooch](https://github.com/pgooch)

---

Top Contributors

[![pgooch](https://avatars.githubusercontent.com/u/1129374?v=4)](https://github.com/pgooch "pgooch (15 commits)")[![llagerlof](https://avatars.githubusercontent.com/u/193798?v=4)](https://github.com/llagerlof "llagerlof (4 commits)")[![inkeliz](https://avatars.githubusercontent.com/u/4644332?v=4)](https://github.com/inkeliz "inkeliz (2 commits)")

---

Tags

cliasciitables

### Embed Badge

![Health badge](/badges/pgooch-php-ascii-tables/health.svg)

```
[![Health](https://phpackages.com/badges/pgooch-php-ascii-tables/health.svg)](https://phpackages.com/packages/pgooch-php-ascii-tables)
```

###  Alternatives

[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B11.3k](/packages/symfony-console)[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.6k331.8M8.5k](/packages/nunomaduro-collision)[nunomaduro/termwind

It's like Tailwind CSS, but for the console.

2.5k239.8M286](/packages/nunomaduro-termwind)[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[wp-cli/php-cli-tools

Console utilities for PHP

68325.0M367](/packages/wp-cli-php-cli-tools)[socialengine/sniffer-rules

A Lumen 5 and Laravel 5 SquizLabs Code Sniffer 2.0 artisan command. Detect violations of a defined coding standard. It helps your code remains clean and consistent.

1248.2k1](/packages/socialengine-sniffer-rules)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
