PHP code example of lubos / table

1. Go to this page and download the library: Download lubos/table library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lubos / table example snippets


Plugin::load('Lubos/Table');

public $helpers = [
    'Lubos/Table.Table'
];

$cells = [
    ['cell 00', 'cell 01', 'cell02'],
    ['cell 10', 'cell 11', 'cell12'],
    ['cell 20', 'cell 21', 'cell22']
];
$this->Table->create();
$this->Table
    ->startRow(['group' => 'head', 'class' => 'header'])
    ->header('header 1')
    ->header('header 2')
    ->header('header 3')
    ->endRow();
foreach ($cells as $row) {
    $this->Table->startRow();
    foreach ($row as $cell) {
        $this->Table->cell($cell);
    }
    $this->Table->endRow();
}
echo $this->Table->display();