PHP code example of jxlwqq / data-table

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

    

jxlwqq / data-table example snippets


'extensions' => [
    'data-table' => [
        // If the value is set to false, this extension will be disabled
        'enable' => true,
        // global options
        'options' => [
             'paging' => false,
             'lengthChange' => false,
             'searching' => false,
             'ordering' => false,
             'info' => false,
             'language' => 'English', // or Chinese
        ]
    ]
]

use Jxlwqq\DataTable\DataTable;

// table
$headers = ['Id', 'Email', 'Name', 'Company'];
$rows = [
    [1, '[email protected]', 'Ms. Clotilde Gibson', 'Goodwin-Watsica'],
    [2, '[email protected]', 'Allie Kuhic', 'Murphy, Koepp and Morar'],
    [3, '[email protected]', 'Prof. Drew Heller', 'Kihn LLC'],
    [4, '[email protected]', 'William Koss', 'Becker-Raynor'],
    [5, '[email protected]', 'Ms. Antonietta Kozey Jr.', 'Goooogle'],
];

$style = ['table-bordered','table-hover', 'table-striped'];

$options = [
    'paging' => true,
    'lengthChange' => false,
    'searching' => false,
    'ordering' => true,
    'info' => true,
    'autoWidth' => false,
];

$dataTable = new DataTable($headers, $rows, $style, $options);

echo $dataTable->render();