Revision: 45170
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at April 26, 2011 22:10 by LemonPro
Initial Code
<?php
//$HTML_Code is where the actual HTML table goes
//If you don't add a border around your table the border won't show up when you //download the excel file.
$HTML_Code = "
<table style=\"border: 2px solid black;\">
<tr>
<td>Row1 Col1</td>
<td>Row1 Col2</td>
<td>Row1 Col3</td>
</tr>
<tr>
<td>Row2 Col1</td>
<td>Row2 Col2</td>
<td>Row2 Col3</td>
</tr>
</table>
";
//$Build file will create the excel file called file_name.xls
//$Build file doesn't add the contents/code into the file.
$Build_File = fopen('file_name.xls', 'w');
//$Edit_File add the HTML table to the excel file.
$Edit_File = fwrite($Build_File,$HTML_Code);
if(!$Edit_File)
{
die("Error!");
}
?>
Initial URL
Initial Description
Initial Title
HTML table with PHP
Initial Tags
table, html
Initial Language
PHP