PHP Classes
elePHPant
Icontem

PHP Array into HTML Table: Generate HTML tables from data in arrays

Recommend this page to a friend!
  Info   View files Example   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2016-10-24 (3 years ago) RSS 2.0 feedNot enough user ratingsTotal: 197 This week: 1All time: 8,269 This week: 359Up
Version License PHP version Categories
array-to-html-table 1.0.0GNU General Publi...5.4HTML, PHP 5
Description Author

This class can generate HTML tables from data in arrays

It can take arrays with data for the headers and body and generates HTML for a table.

The class also allows to pass array of CSS classes to assign to each table column, classes for each row, and hide specific columns.

  Performance   Level  
Name: Alexandre Sinício <contact>
Classes: 6 packages by
Country: Brazil Brazil
Age: 35
All time rank: 2370163 in Brazil Brazil
Week rank: 131 Up6 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 2x

 

Details
It can be a pain to format HTML tables. It can be a pain to output that array of data in an user-friendly way.

This class tries to simplify the job of creating these tables. The basic usage allows to output HTML code with just three lines.

The class also provides enough flexibility to set custom ID and classes to the table, rows and even individual cells.

Every suggestion and/or bug report will be mostly appreciated.
  Files folder image Files  
File Role Description
Accessible without login Plain text file 01_basic_usage.php Example Example - Basic usage
Accessible without login Plain text file 02_defining_classes.php Example Example - Defining classes to elements
Accessible without login Plain text file 03_custom_function_classes.php Example Example - Defining classes to elements through custom functions
Accessible without login Plain text file 04_custom_function_tr_id.php Example Example - Defining ID for 'tr' tags
Accessible without login Plain text file 05_hiding_columns.php Example Example - Hiding unwanted columns
Plain text file HTMLTable.php Class Source class file
Accessible without login Plain text file README.md Data README

 Version Control Unique User Downloads Download Rankings  
 0%
Total:197
This week:1
All time:8,269
This week:359Up