dev-master
9999999-dev http://eddie.taube.se/Classes for HTML Tables
MIT
The Requires
- php >=5.4
by Eddie Taube
html table
Wallogit.com
2017 © Pedro PelĂĄez
Classes for HTML Tables
By Eddie Taube (eddie.taube@gmail.com), (*2)
CTable is intended to be used with Anax-MVC (https://github.com/mosbth/Anax-MVC) but can also easy be used for a custom PHP application., (*3)
To install the package you can use composer, (*4)
composer require edtau/ctable
, download the zipfile or clone it through github. For use with ANAX-MVC it is recommended that you copy the Table folder from src to app src. In the folder you find two classes CTable.php and TableController.php. if you want to test CTable copy the file table.php from the package folder webroot then simple run table.php from your application to test the different tables., (*5)
If you want to use the package in your own custom application there is a couple of things you have to do for the class to work., (*6)
implements \Anax\DI\IInjectionAware
use \Anax\DI\TInjectable;
You have two different options when you want to generate a html-table., (*7)
$table = new CTable();
$data = array(
array('Förnamn', 'Efternamn', 'Ă
lder'),
array('Anders', 'Andersson', '40'),
array('Stig', 'Larsson', '41'),
array('Anna', 'Svensson', '45')
);
$html = $table->table($data);
$html now cointains your generated table the first array automatic becomes the headers of your table. You can also set the id by sending the param to your table when getting the html., (*8)
$html = $table->table($data,$myId);, (*9)
$this->table->setHeader(array('Förnamn', 'Efternamn', 'Ă
lder'));
$array = array(
array('Anders', 'Andersson', '40'),
array('Stig', 'Larsson', '41'),
array('Anna', 'Svensson', '45'),
array('Bengt', 'Andersson', '40'),
array('Karin', 'Larsson', '41'),
array('Ulf', 'Svensson', '45')
);
$html = $this->table->table($array);
The code will generate a table based on your header of course you still have the option to send param id to the table method., (*10)
This software is free software and carries a MIT license., (*11)
v1.0* (2015-11-10), (*12)
Classes for HTML Tables
MIT
html table