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

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

dcarbone/table-mapper
=====================

Complex HTML parsing helper

1.1.1(12y ago)220MITPHPPHP &gt;=5.3.3

Since Apr 11Pushed 12y ago1 watchersCompare

[ Source](https://github.com/dcarbone/table-mapper)[ Packagist](https://packagist.org/packages/dcarbone/table-mapper)[ Docs](https://github.com/dcarbone/table-mapper)[ RSS](/packages/dcarbone-table-mapper/feed)WikiDiscussions master Synced 2mo ago

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

table-mapper
============

[](#table-mapper)

**TableMapper** is a class that I wrote to ease the consumption of complex HTML tables.

**Example**:

```

            Row 0 : Cell 0
            Row 0 : Cell 1

            Row 1 : Cell 0
            Row 1 : Cell 1
            Row 1 : Cell 2

```

Looks something like this:

   Row 0 : Cell 0 Row 0 : Cell 1   Row 1 : Cell 0 Row 1 : Cell 1 Row 1 : Cell 2  That can be tricky to consume, however. So this class creates a clone of the table element you pass in and creates an in-memory version that looks like this:

```

            Row 0 : Cell 0
            Row 0 : Cell 0
            Row 0 : Cell 0
            Row 0 : Cell 1

            Row 1 : Cell 0
            Row 1 : Cell 1
            Row 1 : Cell 2
            Row 0 : Cell 1

```

Which looks like this:

   Row 0 : Cell 0 Row 0 : Cell 0 Row 0 : Cell 0 Row 0 : Cell 1   Row 1 : Cell 0 Row 1 : Cell 1 Row 1 : Cell 2 Row 0 : Cell 1  **Usage**

```
$tableHTML = item(0));
$tableMapper->createMap();

$dom->appendChild($dom->createElement('h1', 'Parsed Table'));

$newTable = $dom->createElement('table');
$dom->appendChild($newTable);

foreach($tableMapper->getRowCellMap() as $groupi=>$groupDef)
{
    foreach($groupDef as $rowi=>$cellMap)
    {
        $newTr = $dom->createElement('tr');
        $newTable->appendChild($newTr);

        foreach($cellMap as $cellNum)
        {
            $cell = $tableMapper->getCell($groupi, $rowi, $cellNum);
            $newTr->appendChild($dom->createElement('td', $cell->nodeValue));
        }
    }
}

echo $dom->saveHTML();
```

This is a very simple class, overall. A few things to note:

- TableMapper does NOT mutate the DOMElement you pass in, it clones and imports it into a new DOM before doing anything.
- TableMapper does not fix invalid HTML
- TableMapper does not do your laundry.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~8 days

Total

3

Last Release

4399d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/385c0c0eae1b51f1e81ee464ff6bfb3cce32589ac252ca68cc3a8aec2e3ada14?d=identicon)[dcarbone](/maintainers/dcarbone)

---

Top Contributors

[![dcarbone](https://avatars.githubusercontent.com/u/1392439?v=4)](https://github.com/dcarbone "dcarbone (5 commits)")

---

Tags

html-tabledomdocument

### Embed Badge

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

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

###  Alternatives

[easyrdf/easyrdf

EasyRdf is a PHP library designed to make it easy to consume and produce RDF.

62231.5M42](/packages/easyrdf-easyrdf)[jolicode/jolitypo

Microtypography fixer for the web.

3471.1M5](/packages/jolicode-jolitypo)[sweetrdf/easyrdf

EasyRdf is a PHP library designed to make it easy to consume and produce RDF.

261.3M11](/packages/sweetrdf-easyrdf)[ropendev/datatablesphp

PHP DataTables wrapper class for DataTables.js (Html and/or Javascript generation, Server-Side SQL) .

286.7k](/packages/ropendev-datatablesphp)

PHPackages © 2026

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