PHP Classes

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    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 382 All time: 6,647 This week: 257Up
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: 11 packages by
Country: Canada Canada
Age: 33
All time rank: 189346 in Canada Canada
Week rank: 895 Up20 in Canada Canada Up
Innovation award
Innovation award
Nominee: 4x

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:382
This week:0
All time:6,647
This week:257Up
For more information send a message to info at phpclasses dot org.