PHPackages                             travail/text-simpletable - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. travail/text-simpletable

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

travail/text-simpletable
========================

travail/text-simpletable

v0.1.3(6y ago)6108.3k2[1 issues](https://github.com/travail/php-Text-SimpleTable/issues)PHP-3.0PHP

Since May 1Pushed 6y ago1 watchersCompare

[ Source](https://github.com/travail/php-Text-SimpleTable)[ Packagist](https://packagist.org/packages/travail/text-simpletable)[ RSS](/packages/travail-text-simpletable/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)DependenciesVersions (6)Used By (0)

Text\\SimpleTable
=================

[](#textsimpletable)

NAME
----

[](#name)

Text\\SimpleTable - Simple Eyecandy ASCII Tables

SYNOPSIS
--------

[](#synopsis)

```
use Text\SimpleTable;

require_once '/path/to/vendor/autoload.php';

$table = new SimpleTable(10, 20);
$table->row('KEY1', 'VALUE1');
$table->row('KEY2', 'VALUE2');
$table->row('KEY3', 'VALUE3');
$table->row('KEY4', 'VALUE4');
$table->row('KEY5', 'VALUE5');
echo $table->draw();
/*
.------------+----------------------.
| KEY1       | VALUE1               |
| KEY2       | VALUE2               |
| KEY3       | VALUE3               |
| KEY4       | VALUE4               |
| KEY5       | VALUE5               |
'------------+----------------------'
*/

$table = new SimpleTable(array(10, 'KEY'), array(20, 'VALUE'));
$table->row('KEY1', 'VALUE1');
$table->row('KEY2', 'VALUE2');
$table->row('KEY3', 'VALUE3');
$table->row('KEY4', 'VALUE4');
$table->row('KEY5', 'VALUE5');
echo $table->draw();
/*
.------------+----------------------.
| KEY        | VALUE                |
+------------+----------------------+
| KEY1       | VALUE1               |
| KEY2       | VALUE2               |
| KEY3       | VALUE3               |
| KEY4       | VALUE4               |
| KEY5       | VALUE5               |
'------------+----------------------'
*/

$table = new SimpleTable(10, 20);
$table->row('KEY1', 'VALUE1');
$table->hr();
$table->row('KEY2', 'VALUE2');
$table->hr();
$table->row('KEY3', 'VALUE3');
echo $table->draw();
/*
.------------+----------------------.
| KEY1       | VALUE1               |
+------------+----------------------+
| KEY2       | VALUE2               |
+------------+----------------------+
| KEY3       | VALUE3               |
'------------+----------------------'
*/

$table = new SimpleTable(array(10, '国'), array(20, '首都'));
$table->row('日本', '東京');
$table->row('America', 'Washington D.C.');
$table->row('England', 'London');
$table->row('France', 'Paris');
$table->row('台湾', '台北');
// Set encoding, "UTF-8" by default.
// $table->setEncoding($encoding);
echo $table->draw();
/*
.------------+----------------------.
| 国         | 首都                 |
+------------+----------------------+
| 日本       | 東京                 |
| America    | Washington D.C.      |
| England    | London               |
| France     | Paris                |
| 台湾       | 台北                 |
'------------+----------------------'
*/
```

INSTALLATION
------------

[](#installation)

To install this package into your project via composer, add the following snippet to your `composer.json`. Then run `composer install`.

```
"require": {
    "travail/text-simpletable": "dev-master"
}

```

If you want to install from gihub, add the following:

```
"repositories": [
    {
        "type": "vcs",
        "url": "git@github.com:travail/php-Text-SimpleTable.git"
    }
]

```

METHODS
-------

[](#methods)

### \_\_construct

[](#__construct)

```
__construct(int $width [, int $width [, ...]])
```

To draw simple table set *$width* to the number of columns.

```
__construct(array ($width, $col_name) [, array ($width, $col_name) [, ...]])
```

To draw table with header set *$width* and *$col\_name* in array to the number of columns.

### row

[](#row)

```
void row(string $value [, string $value [, ...]])
```

Draw row.

### hr

[](#hr)

```
void hr(void)
```

Draw horizontal rule.

### setEncoding

[](#setencoding)

```
void setEncoding(string $encoding)
```

To draw table with multibyte characters set current character encoding. *UTF-8* by default.

### getEncoding

[](#getencoding)

```
string getEncoding()
```

Returns current character encoding.

### draw

[](#draw)

```
string draw(void)
```

Draw text table.

THANKS TO
---------

[](#thanks-to)

Sebastian Riedel, `sri@cpan.org`.

AUTHOR
------

[](#author)

travail

LICENSE
-------

[](#license)

This library is free software. You can redistribute it and/or modify it under the same terms as PHP itself.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.8% 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

Every ~670 days

Total

4

Last Release

2391d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/52314?v=4)[travail](/maintainers/travail)[@travail](https://github.com/travail)

---

Top Contributors

[![travail](https://avatars.githubusercontent.com/u/52314?v=4)](https://github.com/travail "travail (30 commits)")[![gilbite](https://avatars.githubusercontent.com/u/423259?v=4)](https://github.com/gilbite "gilbite (1 commits)")[![tisogawa](https://avatars.githubusercontent.com/u/145603?v=4)](https://github.com/tisogawa "tisogawa (1 commits)")

### Embed Badge

![Health badge](/badges/travail-text-simpletable/health.svg)

```
[![Health](https://phpackages.com/badges/travail-text-simpletable/health.svg)](https://phpackages.com/packages/travail-text-simpletable)
```

###  Alternatives

[nsulistiyawan/bpjs

Wrapper for BPJS Indonesia

425.2k](/packages/nsulistiyawan-bpjs)[wujunze/laravel-id-generate

Laravel package to generate and to validate a UUID according to the RFC 4122 standard. Only support for version 1, 3, 4 and 5 UUID are built-in. and generate number id, generate primary key

134.4k](/packages/wujunze-laravel-id-generate)

PHPackages © 2026

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