PHP Classes

PHP HTML Table to Excel or Word: Convert a HTML table to Excel or Word formats

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 592 This week: 1All time: 5,248 This week: 560Up
Version License PHP version Categories
html-to-excel 1GNU General Publi...5HTML, PHP 5, Files and Folders
Description 

Author

This class can convert a HTML table to Excel or Word formats.

It can take a given string with an HTML table and builds an Excel or Word XML format to contain the given HTML table data.

If the HTML string contains more than a HTML table, the class strips the remaining HTML just to insert the table data.

The resulting documents can be returned as strings or served for download.

Picture of Matteo Lucarno
  Performance   Level  
Name: Matteo Lucarno <contact>
Classes: 1 package by
Country: Italy Italy
Age: 33
All time rank: 3066116 in Italy Italy
Week rank: 416 Up16 in Italy Italy Up

Recommendations

What is the best PHP html table to excel file class?
Convert HTML output table data into Excel using php

Example

<?php
require 'src/HTMLOffice/HTMLOffice.php'

class Example {

   
$sampleHTMLTable = '<table>
                            <tr><td>Cell1</td><td>Cell2</td></tr>
                            <tr><td colspan=2>Unified</td></tr>
                        </table>'
;

    public function
__construct(){
       
$officeExporter = new HTMLOffice();
       
$officeExporter->exportToExcel($sampleHTMLTable,'Export testing');
    }
}

?>


  Files folder image Files  
File Role Description
Files folder imagesrc (1 directory)
Accessible without login Plain text file example.php Example Example

  Files folder image Files  /  src  
File Role Description
Files folder imageHTMLOffice (1 file)

  Files folder image Files  /  src  /  HTMLOffice  
File Role Description
  Plain text file HTMLOffice.php Class Main class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:592
This week:1
All time:5,248
This week:560Up