PHPackages                             lloricode/laravel-html-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. lloricode/laravel-html-table

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

lloricode/laravel-html-table
============================

Html table generator for laravel

v2.1.2(1y ago)1561.9k—2.5%1MITPHPPHP ^8.2CI passing

Since Jul 19Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/lloricode/laravel-html-table)[ Packagist](https://packagist.org/packages/lloricode/laravel-html-table)[ Fund](https://www.paypal.com/donate?hosted_button_id=V8PYXUNG6QP44)[ RSS](/packages/lloricode-laravel-html-table/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (21)Used By (1)

Laravel HTML Table
==================

[](#laravel-html-table)

[![Latest Version on Packagist](https://camo.githubusercontent.com/868f0acb8c1bc6d1c0eb83af5a99572be8e8254b7db34fa4d3effc3cef1bae9f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6c6f7269636f64652f6c61726176656c2d68746d6c2d7461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lloricode/laravel-html-table)[![GitHub Tests Action Status](https://camo.githubusercontent.com/d1176f22754b69757048d587b5b7f0d3ff6b8e65a2087522e36c4a783ba8e84d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6c6f7269636f64652f6c61726176656c2d68746d6c2d7461626c652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/lloricode/laravel-html-table/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/02afe5ae6411e71a5644f2eb67d4b2dc34ac95423b9960cb6d98007b1136b3a8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6c6f7269636f64652f6c61726176656c2d68746d6c2d7461626c652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/lloricode/laravel-html-table/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/45dac9a3ae1392489bc0eecf622e5027d0f805acbfe6f102ef7a4f5dcb316a9d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6c6f7269636f64652f6c61726176656c2d68746d6c2d7461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lloricode/laravel-html-table)[![codecov](https://camo.githubusercontent.com/01b19efbba3600e1fbaa6cebe3852127cfd73adc1f95a855bce65008cb416cf1/68747470733a2f2f636f6465636f762e696f2f67682f6c6c6f7269636f64652f6c61726176656c2d68746d6c2d7461626c652f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d6751524853775958416d)](https://codecov.io/gh/lloricode/laravel-html-table)

Generate Html Table with data from array/object.

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

[](#installation)

You can install the package via composer:

```
composer require lloricode/laravel-html-table
```

Usage
-----

[](#usage)

### Sample in view

[](#sample-in-view)

```
$headers = ['col1', 'col2'];

$data = [
    [
        'Lloric', 'Garcia',
    ],
    [
        'Foo', 'Bar',
    ],
    [
        'Foo1', 'bar11',
    ],
    [
        'tst', 'tesss',
    ],
];

$attributes = 'class="table"';
// Or
$attributes = ['myclass' => 'test_val'];

{!! Table::generate($headers, $data) !!}

{!! Table::generate($headers, $data, $attributes) !!}

// Model way

{!!
    Table::generateModel(
        ['Id', 'Name', 'Email'],  // Column for table
        'App\User' // Model
        ,['id', 'name', 'email'], // Fields from model
        0, // Pagination Limit, if 0 all will show
        'border="1"' // Attributes sample js/css
    )
!!}

{{ Table::links() }} // Generate this when limit is not 0

// then you can add a links

{!!
    Table::optionLinks('my.route.name')
        ->modelResult(function($query){  // you can add filter if you are using model generate
            $query->where('user_id', auth()->user()->id);
            return $query;
        })
        ->generateModel(
            ['Id', 'Name', 'Email'],  // Column for table
            'App\User' // Model
            ,['id', 'name', 'email'], // Fields from model
            5, // Pagination Limit, if 0 all will show
            'border="1"' // Attributes sample js/css
        )
!!}

// you can specify more args
// 1st route name, 2nd header label, and 3rd is the every row label
{!!
    Table::optionLinks('my.route.name', 'my option', 'view')
        ->generateModel(
            ['Id', 'Name', 'Email'],  // Column for table
            'App\User' // Model
            ,['id', 'name', 'email'], // Fields from model
            5, // Pagination Limit, if 0 all will show
            'border="1"' // Attributes sample js/css
        )
!!}
```

### This is all default values html tags

[](#this-is-all-default-values-html-tags)

```
$attributes = [
    // Main Table
    'table' => '',
    'table_end' => '',

    // Head
    'head' => '',
    'head_end' => '',

    'head_row' => '',
    'head_row_end' => '',
    'head_cell' => '',
    'head_cell_end' => '',

    // Data body
    'body' => '',
    'body_end' => '',

    'body_row' => '',
    'body_row_end' => '',
    'body_cell' => '',
    'body_cell_end' => '',

    // Alternative
    'alt_body_row' => '',
    'alt_body_row_end' => '',
    'alt_body_cell' => '',
    'alt_body_cell_end' => '',
];

{!! Table::generate($headers, $data, $attributes) !!}
```

### Sample Output

[](#sample-output)

```
col1col2LloricGarciaFooBarFoo1bar11tsttesss
```

### Adding attributes in cell data

[](#adding-attributes-in-cell-data)

```
$header = ['Date', 'Description', 'Amount'];
$datas = [
    [
        ['data' => '1', 'scope' => 'row'],
        'Mark',
        'Otto',
    ],
    [
        ['data' => '2', 'scope' => 'row'],
        'foo',
        'varr',
    ],
];

{!! Table::generate($header, $datas, ['class'=>'table']) !!}

           Date
           Description
           Amount

           1
           Mark
           Otto

           2
           foo
           varr

```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Lloric Mayuga Garcia](https://github.com/lloricode)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance68

Regular maintenance activity

Popularity37

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor1

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

Recently: every ~586 days

Total

17

Last Release

451d ago

Major Versions

v1.3.4 → v2.0.02023-05-13

PHP version history (3 changes)v1.3.0PHP &gt;=7.0

v2.0.0PHP ^8.1

v2.1.2PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/1cdb70b3c1af4426f87d055490f2337dae57cb3bd884b013c5c068f8ee24fab1?d=identicon)[lloricode](/maintainers/lloricode)

---

Top Contributors

[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (155 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (24 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (13 commits)")

---

Tags

hacktoberfesthtmllaraveltable

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/lloricode-laravel-html-table/health.svg)

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

###  Alternatives

[guava/calendar

Adds support for vkurko/calendar to Filament PHP.

298241.0k3](/packages/guava-calendar)[tonysm/rich-text-laravel

Integrates Trix content with Laravel

46577.8k1](/packages/tonysm-rich-text-laravel)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[tonysm/globalid-laravel

Identify app models with a URI. Inspired by the globalid gem.

45101.6k2](/packages/tonysm-globalid-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[spatie/laravel-screenshot

Take screenshots of web pages in Laravel apps

7615.9k2](/packages/spatie-laravel-screenshot)

PHPackages © 2026

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