PHP Classes

PHP Table Chart Builder: Create HTML table with values and calculated cells

Recommend this page to a friend!
  Info   Documentation   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 58%Total: 394 All time: 6,625 This week: 47Up
Version License PHP version Categories
table-chart-builder 1.0.6MIT/X Consortium ...5HTML, PHP 5, Math
Description 

Author

This package can create HTML table with values and calculated cells.

It takes an array that defines the title of a table, the header names, values for the cells and expressions to be used in calculated cells.

The class generates a HTML table with provided values and computes the values of the calculated cells based on the column values.

Innovation Award
PHP Programming Innovation award nominee
December 2016
Number 5


Prize: One downloadable copy of PhpED Professional
Many PHP applications display data retrieved from databases or arrays in HTML tables as is, I mean as they are retrieved from the data source.

Often you need to generate reports that show calculations performed on the data displayed in the table columns.

The class can display data in table cells including additional values that show calculated cells that result from operations on column values like total, average, lowest and highest.

Manuel Lemos
Picture of Gavin Gordon Markowski
  Performance   Level  
Name: Gavin Gordon Markowski <contact>
Classes: 13 packages by
Country: Canada Canada
Age: 36
All time rank: 178441 in Canada Canada
Week rank: 131 Up3 in Canada Canada Up
Innovation award
Innovation award
Nominee: 5x

Documentation

TableChartBuilder v1.0.6

Build Status

Description

This php class package allows you to create dynamic HTML tables that can calculate column data, like Excel, and look good doing it. Although it is compatible with CSS Bootstrap 3+, Bootstrap is not required for the resulting table to be both responsive, as well as styled beautifully.

How to Use

Install

	$ composer require gavinggordon/tablechartbuilder

Autoload

	include( 'vendor/autoload.php' );

Insantiate

	$table = new GGG\Html\Builders\TableChartBuilder();

Configure

	$table->configure( [
		'title' => '',
		'headers' => [
			'Q1', 'Q2', 'Q3', 'Q4'
		],
		'data' => [
			[ 10000, 5000, 7500, 5000 ],
			[ 13000, 1600, 2500, 8000 ],
			[ 15000, 7400, 3600, 2500 ]
		],
		'equation' => [
			'total', 'average', 'lowest', 'highest'
		]
	] );

Render

	$html = $table->render();
	echo $html;

More Information

PHP Innovation Award

This class has been awarded a PHP Innovation Award, provided by PHPClasses.org. My other PHP classes are accessible online via my GitHub profile or PHPClasses.org profile.


Screenshots (2)  
  • tablechart-inlinecss-example.png
  • tablechart-cssbootstrap-example.png
  Files folder image Files (17)  
File Role Description
Files folder imagebackups (1 file)
Files folder imagesrc (2 files, 3 directories)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE.txt Doc. Documentation
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (17)  /  backups  
File Role Description
  Accessible without login Plain text file HtmlTableBU.txt Doc. Documentation

  Files folder image Files (17)  /  src  
File Role Description
Files folder imageAbstracts (1 file)
Files folder imageCalculations (5 files)
Files folder imageInterfaces (1 file)
  Plain text file Table.php Class Class source
  Plain text file TableChartBuilder.php Class Class source

  Files folder image Files (17)  /  src  /  Abstracts  
File Role Description
  Plain text file Calculation.php Class Class source

  Files folder image Files (17)  /  src  /  Calculations  
File Role Description
  Plain text file Average.php Class Class source
  Plain text file Difference.php Class Class source
  Plain text file Highest.php Class Class source
  Plain text file Lowest.php Class Class source
  Plain text file Total.php Class Class source

  Files folder image Files (17)  /  src  /  Interfaces  
File Role Description
  Plain text file CalculationInterface.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 88%
Total:394
This week:0
All time:6,625
This week:47Up
 User Ratings  
 
 All time
Utility:81%StarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:87%StarStarStarStarStar
Examples:-
Tests:-
Videos:-
Overall:58%StarStarStar
Rank:1574