PHP Classes
elePHPant
Icontem

Tabler: Generate HTML5 table with Bootstrap

Recommend this page to a friend!
  Info   View files Documentation   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2016-04-14 (6 months ago) RSS 2.0 feedNot enough user ratingsTotal: 352 This week: 2All time: 6,591 This week: 591Up
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: 7 packages by
Country: Canada Canada
Innovation award
Innovation award
Nominee: 2x

Details

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  
File Role Description
Plain text file README.md Doc. Information and Example
Plain text file Tabler.class.php Class Main class source file

 Version Control Unique User Downloads Download Rankings  
 0%
Total:352
This week:2
All time:6,591
This week:591Up