Download the PHP package andydune/html-table without Composer
On this page you can find all versions of the php package andydune/html-table. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download andydune/html-table
More information about andydune/html-table
Files in andydune/html-table
Package html-table
Short Description This code will simplify or improve your work with html tables.
License MIT
Homepage https://github.com/AndyDune/HtmlTable
Informations about the package html-table
HtmlTable
This code will simplify or improve your work with html tables.
Requirements
PHP version >= 5.6
Installation
Installation using composer:
Or if composer was not installed globally:
Or edit your composer.json
:
And execute command:
Example
Here is small part of code for drawing html table with dynamic data.
It is simple to accidentally break html by removing single tag. And it is difficult to read and change.
There is better code down below:
Class structure
Table structure is reflect by classes:
AndyDune\HtmlTable\Table
- a root of the structureAndyDune\HtmlTable\Element\Row
- it implements a table rowAndyDune\HtmlTable\Element\Head
- it implements a special table row (head). It can be only one.-
AndyDune\HtmlTable\Element\Cell
- it implements a table cell. It is a part ofRow
(Head
) -
AndyDune\HtmlTable\Builder
- the root class for building html code for table. It receivesTable
instance as a construct parameter. - There are many assistive classes for building table, but you don't need to know about their.
Describe table
Table may have attributes, data rows, head row. Rows and cells may have attributes too.
Table, row, cell class attribute
Use method addClass
to inject class into table element. Element may have many classes:
Table, row, cell id attribute
Use method setId
to inject id into table element. Element may have only one id: