PHP Classes

PHP HTML Excel: Convert HTML to Excel spreadsheets

Recommend this page to a friend!
  Info   View files Documentation   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (5)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2021-11-07 (10 months ago) RSS 2.0 feedStarStarStarStar 65%Total: 2,035 This week: 3All time: 1,922 This week: 41Up
Version License PHP version Categories
htmlexcel 1.0.1Custom (specified...5Utilities and Tools
Description Author

This class can convert HTML to Excel spreadsheets.

It can take the HTML of a table rows and headers, as well optional CSS, and generates a file that can be opened as a spreadsheet in Microsoft Excel.

The class can serve the Excel file for download using the appropriate headers for making it open in Excel or equivalent server in the user machine.

This class is able to create Excel spreadsheets directly from HTML tables. It is possible to use CSS for styling.


What is the best PHP export excel class?
Trying to export query to an Excel file

Picture of Gustavo Alves
  Performance   Level  
Name: Gustavo Alves <contact>
Classes: 1 package by
Country: Brazil Brazil
Age: 34
All time rank: 148497 in Brazil Brazil
Week rank: 50 Up2 in Brazil Brazil Up



Turn HTML tables into multi-sheet Excel files.



$css = "
.red {
	color: red;

$numbers = '<table>
	<td class="red">1</td>
	<td class="red">5</td>
	<td class="red">9</td>

$names = '<table>
    <th>First name</th>
    <th>Last name</th>

$xls = new HtmlExcel();
$xls->addSheet("Numbers", $numbers);
$xls->addSheet("Names", $names);
echo $xls->buildFile();
  Files folder image Files  
File Role Description
Plain text file HtmlExcel.php Class Class source
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
This week:3
All time:1,922
This week:41Up
User Ratings User Comments (1)
 All time
For more information send a message to info at phpclasses dot org.