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

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

pliusnin/php-table
==================

Help you to render array of data as a paginated table

1.0.0(3y ago)02proprietaryPHPPHP &gt;=7.4

Since Jan 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/pliusnin/php-table)[ Packagist](https://packagist.org/packages/pliusnin/php-table)[ RSS](/packages/pliusnin-php-table/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

PHPTable
--------

[](#phptable)

This package helps to render array of data as an HTML table. Demo templates uses Bootstrap classes and written using Twig template engine.

### How to install and use

[](#how-to-install-and-use)

```
composer require pliusnin/php-table

```

Usage is simple as that. First, include required dependencies:

```
use PhpTable\DataTable\DataTableFactory;
use Twig\Environment;
use Twig\Loader\FilesystemLoader;

```

Then you have to prepare array of data which should be rendered in the table. It's simple array of arrays:

```
$dataArray = [
    [
        'id' => 1,
        'firstName' => 'Dow',
        'lastName' => 'Jones',
        'email' => 'dow,jones@gmail.com'
    ]
];

```

After that you need to initiate Twig environment to the path you have templates:

```
$twig = new Environment(new FilesystemLoader(['path/to/templates']));

```

Twig instance should be passed to DataTableFactory as a parameter. Then `create` method should be called with data and configuration as parameters:

```
$dataTableRenderer = (new DataTableFactory($twig))->create($dataArray, [
    'id' => ['label' => 'ID'],
    'name' => [
      'label' => 'Full Name', // heading label of the column
      'format' => function ($row) { //you can format what and how should be rendered in the field
          return $row['lastName'] . ', ' . $row['firstName'];
      },
      'order' => 2 // you can change the order of column
    ],
    'email' => [
        'label' => 'Email',
    ]
]);

```

In the place you want to render the table and pagination, call these methods:

```
$dataTableRenderer->render(); // return HTML string
$dataTableRenderer->renderPagination(); // return HTML string

```

Enjoy! Templates can be customized, just create your own and pass the path to the Twig Environment. Follow the structure and logic of the original twig templates.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Unknown

Total

1

Last Release

1223d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/27d36b151bef9aa7188c708b7b03f5163e31f55350ed3aaf1d40b5653425f619?d=identicon)[pliusnin](/maintainers/pliusnin)

---

Top Contributors

[![pliusnin](https://avatars.githubusercontent.com/u/2445273?v=4)](https://github.com/pliusnin "pliusnin (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[stfalcon/tinymce-bundle

This Bundle integrates TinyMCE WYSIWYG editor into a Symfony2 project.

2692.9M24](/packages/stfalcon-tinymce-bundle)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)

PHPackages © 2026

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