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   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 594 All time: 5,235 This week: 72Up
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: 3064116 in Italy Italy
Week rank: 195 Up9 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 (2)  
File Role Description
Files folder imagesrc (1 directory)
Accessible without login Plain text file example.php Example Example

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

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

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  
 0%
Total:594
This week:0
All time:5,235
This week:72Up