PHP Classes

Tabler: Generate HTML5 table with Bootstrap

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 385 All time: 6,700 This week: 488Up
Version License PHP version Categories
tabler 1.0.0MIT/X Consortium ...5.4HTML, PHP 5
Description 

Author

This class can generate HTML5 table programatically.

It can take as parameters the title of a table, the header data, table cell data, and optional custom CSS.

The class builds the HTML table from parameters and can either output the resulting table or return it as string.

Picture of Gavin Gordon Markowski
  Performance   Level  
Name: Gavin Gordon Markowski <contact>
Classes: 13 packages by
Country: Canada Canada
Age: 36
All time rank: 178541 in Canada Canada
Week rank: 49 Up1 in Canada Canada Up
Innovation award
Innovation award
Nominee: 5x

Documentation

Tabler

This class allows the ability to quickly create custom HTML5 Bootstrap 3.3.6 tables.

Instantiation Examples

Non-Static Method:

include_once( __DIR__ . '/Tabler.class.php' );

$title = 'My Table'; // table title; REQUIRED

$data = [ ['John','25','male'], ['Jane','32','female'] ]; // table cell data; REQUIRED

$headers = ['Name','Age','Gender']; // table headers; REQUIRED

$doReturn = false; // false = echo html; true = return html; OPTIONAL

$customcss = false; // Use custom css? OPTIONAL

$tabler = new Tabler( $title, $data, $headers ); // instantiate tabler;

$tabler::view(); // view table

Static Method #1:

Tabler::$_title = 'My Table'; // title of the table;

Tabler::$_headers = ['Name','Age','Gender']; // table headers <th>*</th>;

Tabler::$_data = [ ['John','25','male'], ['Jane','32','female'] ]; // table cells <td>*</td>;

Tabler::$_return = false; // false = echo html; true = return html;

Tabler::$_style = false; // Use custom style?

Tabler::view(); // view table;

Static Method #2:

$options = [];

$options['title'] = 'My Table';

$options['data'] = [ ['John','25','male'], ['Jane','32','female'] ];

$options['headers'] = ['Name','Age','Gender'];

$options['doReturn'] = false;

$options['customcss'] = false;

$table = Tabler::_singleton( $opt ); // returns html code;

echo $table; // echo table html code;


  Files folder image Files (2)  
File Role Description
Plain text file README.md Doc. Information and Example
Plain text file Tabler.class.php Class Main class source file

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:385
This week:0
All time:6,700
This week:488Up