PHPackages                             dbt/table - 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. dbt/table

ActiveProject

dbt/table
=========

Objects to represent fixed-length tabular data

1.0.10(4y ago)01.6k↓100%MITPHPPHP &gt;=7.4

Since Jun 10Pushed 4y ago1 watchersCompare

[ Source](https://github.com/DeBoerTool/table)[ Packagist](https://packagist.org/packages/dbt/table)[ Docs](https://github.com/dbt/table)[ RSS](/packages/dbt-table/feed)WikiDiscussions trunk Synced today

READMEChangelog (10)Dependencies (4)Versions (12)Used By (0)

Table
=====

[](#table)

A set of objects to represent tabular data with fixed-width rows. Values are represented with strings.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require dbt/table
```

Usage
-----

[](#usage)

Create a new table:

```
use Dbt\Table\Table;
use Dbt\Table\Row;
use Dbt\Table\Cell;

/**
 * Standard construction.
 */
$table = new Table(
    new Row(
        new Cell('row 0 / cell 0'),
        new Cell('row 0 / cell 1')
    ),
    new Row(
        new Cell('row 1 / cell 0'),
        new Cell('row 1 / cell 1')
    )
);

/**
 * From array.
 */
$table = Table::fromArray([
    ['row 0 / cell 0', 'row 0 / cell 1'],
    ['row 1 / cell 0', 'row 1 / cell 1'],
]);

/*
 * Rows must have the same length. This will throw a LengthException:
 */
$table = Table::fromArray([
    ['row 0, cell 0', 'row 0, cell 1'],
    ['row 1, cell 0'], // Too short!
]);
```

Tables and rows are list objects that can be iterated over and pushed to:

```
use Dbt\Table\Table;
use Dbt\Table\Row;
use Dbt\Table\Cell;

$table = Table::fromArray([['row 0 / cell 0'], ['row 1 / cell 0']]);

/**
 * @var int $rowIndex
 * @var \Dbt\Table\Row $row
 */
foreach ($table as $rowIndex => $row) {
    var_dump(count($table), count($row));

    /**
     * @var int $cellIndex
     * @var \Dbt\Table\Cell $cell
     */
    foreach ($row as $cellIndex => $cell) {
        var_dump($cell->value());
    }
}

$table->push(new Row(new Cell('row 2 / cell 0')));
```

Cells can be created from scalars or arrays of scalars:

```
use \Dbt\Table\Cell;

/**
 * This int will be cast to a string.
 */
$cell = Cell::make(1);

/**
 * This array will be serialized to a JSON string.
 */
$cell = Cell::make(['string', 1, 9.9, true]);
```

Tables, Rows, and Cells are not intended to be modified after being set. Though you can push to a Table and a Row, you cannot modify existing values.

Etc.
----

[](#etc)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details. The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~7 days

Recently: every ~17 days

Total

11

Last Release

1679d ago

PHP version history (2 changes)1.0.0PHP ^7.4

1.0.10PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/ebd3fe214b5768e700ae43c7fdc4b83d249972a6a97a0faef372d0ec19256eca?d=identicon)[danielsdeboer](/maintainers/danielsdeboer)

---

Top Contributors

[![danielsdeboer](https://avatars.githubusercontent.com/u/13170241?v=4)](https://github.com/danielsdeboer "danielsdeboer (18 commits)")

---

Tags

phptabledbt

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dbt-table/health.svg)

```
[![Health](https://phpackages.com/badges/dbt-table/health.svg)](https://phpackages.com/packages/dbt-table)
```

###  Alternatives

[stevebauman/eloquenttable

An HTML table generator for laravel collections

4650.6k](/packages/stevebauman-eloquenttable)[malios/php-to-ascii-table

A PHP library to generate plain text tables.

30110.5k1](/packages/malios-php-to-ascii-table)

PHPackages © 2026

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