PHP code example of aizhar777 / cell

1. Go to this page and download the library: Download aizhar777/cell 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/ */

    

aizhar777 / cell example snippets


'Cell' => Aizhar777\Cell\Facades\Cell::class,

namespace App\Http\Controllers;

class TestController extends Controller
{
    public function index()
    {
        $table = \Cell::create()
            ->addClass('table table-bordered')
            ->addRowNames(['row0', 'row1', 'row2'])
            ->addColNames(['col0', 'col1', 'col2'])
            ->td('row0', 'col0', 'Diag 0')
            ->td('row1', 'col1', 'Diag 1')
            ->td('row2', 'col2', 'Diag 2');
        
        return view('test_view', ['table' => $table->render()]);
    }
}


$table = \Cell::create()
    ->addRowNames(['T', 'B.T', 'B.B.T', 'B.B.B'])
    ->addColNames(['L', 'R.L', 'R.R.L', 'R.R.R'])
    ->td('T', '', 'top')
    ->td('B', 'L', 'bottom left')
    ->td('B.T', 'R', 'B.T / R')
    ->td('B.B', 'R.L', 'B.B / R.L')
    ->td('B.B.T', 'R.R', 'B.B.T / R.R')
    ->td('B.B.B', 'R.R.L', 'B.B.B / R.R.L')
    ->td('B.B.B', 'R.R.R', 'B.B.B / R.R.R');