PHP Classes

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

Recommend this page to a friend!
  Info   View files Documentation   Screenshots Screenshots   View files View files (15)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog (1)    
Ratings Unique User Downloads Download Rankings
StarStarStar 58%Total: 391 All time: 6,633 This week: 129Up
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: 178741 in Canada Canada
Week rank: 312 Up11 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  
  • tablechart-inlinecss-example.png
  • tablechart-cssbootstrap-example.png
  Files folder image Files  
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  /  backups  
File Role Description
  Accessible without login Plain text file HtmlTableBU.txt Doc. Documentation

  Files folder image Files  /  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  /  src  /  Abstracts  
File Role Description
  Plain text file Calculation.php Class Class source

  Files folder image Files  /  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  /  src  /  Interfaces  
File Role Description
  Plain text file CalculationInterface.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 88%
Total:391
This week:0
All time:6,633
This week:129Up
 User Ratings  
 
 All time
Utility:81%StarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:87%StarStarStarStarStar
Examples:-
Tests:-
Videos:-
Overall:58%StarStarStar
Rank:1536