PHPackages                             jacopo/bootstrap-3-table-generator - 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. jacopo/bootstrap-3-table-generator

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

jacopo/bootstrap-3-table-generator
==================================

Dynamic table generator for bootstrap 3

1411.5k3[1 issues](https://github.com/intrip/bootstrap-table-generator/issues)1PHP

Since Jun 3Pushed 7y ago2 watchersCompare

[ Source](https://github.com/intrip/bootstrap-table-generator)[ Packagist](https://packagist.org/packages/jacopo/bootstrap-3-table-generator)[ RSS](/packages/jacopo-bootstrap-3-table-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (1)

Bootstrap 3 Table generator
---------------------------

[](#bootstrap-3-table-generator)

This package is a dynamic table generator for Bootstrap 3 written in Php. This package is fully tested and ready for use.

[![Build Status](https://camo.githubusercontent.com/a1823a431d63fd99a0b73104764bb075be508ee06381165f1145c8d8cb691114/68747470733a2f2f7472617669732d63692e6f72672f696e747269702f626f6f7473747261702d7461626c652d67656e657261746f722e706e67)](https://travis-ci.org/intrip/bootstrap-table-generator)

### Installation

[](#installation)

The first requisite to run the package is to include Bootstrap 3 in your Application. For more info see: [this link](http://getbootstrap.com/getting-started/).

The next step is to install this package through Composer. Edit your project's `composer.json` file to require `"jacopo/bootstrap-3-table-generator": "dev-master"`.

```
"require": {
	"jacopo/bootstrap-3-table-generator": "dev-master"
},
"minimum-stability" : "dev"

```

Next, update Composer from the Terminal:

```
composer update

```

That's it. You successfully installed Bootstrap 3 table generator!

### Usage

[](#usage)

To use te package you need to require `Jacopo\Bootstrap3Table\BootstrapTable`. Here is an example for a quick usage of the tool:

```
use Jacopo\Bootstrap3Table\BootstrapTable;

// create the generator class
$table = new BootstrapTable();
// set the configuration
$table->setConfig(array("table-hover"=>false, "table-condensed"=>true, "table-striped"=>true ) );
// set header content (optional)
$table->setHeader(array("firstCol") );
// add table row
$table->addRows(array("cell1","cell2"), array("custom-class1"));
// you can also add a bigger row
$table->addRows(array("cell1","cell2","cell3"));
// or add a smaller row
$table->addRows(array("cell1"));

// setup extra custom css classes for the table
$table->setTableExtraClasses(array("extra-table"));
// print the table
echo $table; // equals to echo $table->getHtml();
```

### Methods overview

[](#methods-overview)

The methods available are:

`setConfig`: set the base configuration of the table. Accepts an array of options. The option available are:

`table-striped`: Adds zebra-striping to any table row . `table-bordered`: Add borders and rounded corners to the table. `table-hover`: Enable a hover state on table rows. `table-condensed`: Makes tables more compact by cutting cell padding in half. `table-responsive`: Makes table responsive. `id`: Set the id of the table.

You can also add extra css classes to the ``tag. To do that you need to set the `setTableExtraClasses()`method.

Example:

```
$table = new BootstrapTable();
$table->setTableExtraClasses(array("extra-custom-class") );
```

`setHeader`: this method setup the header of the file, the only parameter is an array that contains the data of each ``. Setting header is optional, if not setted the header won't be shown.

Example:

```
$table = new BootstrapTable();
$table->setHeader(array("First header column data") );
```

`addRows`: add a row of data to the table. Accepts two params: the fist is the array of data, the second is an array of custom css classes to add to the `` tag.

Example:

```
$table = new BootstrapTable();
$table->addRows(array("First data column data"), array("custom-class1") );
```

#### Dynamic Size

[](#dynamic-size)

Keep in mind that you dont have to set the size of the table, you can add as many rows as you want and the table size will adjust automatically!

#### Printing the table

[](#printing-the-table)

When you're done setting up you table you can just do `echo $table` and you'll see the table as html. If you prefer you can get the html string of the table instead with the `table->getHtml()` method.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity40

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1a259b772e3ba1fd5832b676fc5c116107016d12852f93686c2b245311a04c6?d=identicon)[jacopo-beschi](/maintainers/jacopo-beschi)

---

Top Contributors

[![intrip](https://avatars.githubusercontent.com/u/1753245?v=4)](https://github.com/intrip "intrip (15 commits)")[![lucakiebel](https://avatars.githubusercontent.com/u/18332504?v=4)](https://github.com/lucakiebel "lucakiebel (1 commits)")

### Embed Badge

![Health badge](/badges/jacopo-bootstrap-3-table-generator/health.svg)

```
[![Health](https://phpackages.com/badges/jacopo-bootstrap-3-table-generator/health.svg)](https://phpackages.com/packages/jacopo-bootstrap-3-table-generator)
```

PHPackages © 2026

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