danek/table-generator

PHP library for generating simple HTML tables

dev-main 2022-07-04 09:35 UTC

This package is auto-updated.

Last update: 2024-11-04 14:38:31 UTC


README

PHP library for generating simple HTML tables

Contents

Requirements

  • PHP 7.1+

Usage example

<?php

use Danek\TableGenerator\Table;

$gen = new Table('my-table', ['striped', 'hover', 'bordered', 'small']);
$gen->setHeaderColumns(['#', 'Name', 'Category', 'Autor']);
$gen->setBodyRows([
    [1, 'Lorem ipsum', 'Foo', 'John Doe'],
    [2, 'Sed ut perspiciatis', 'Bar', 'Jane Down'],
]);

echo $gen->render();