How to output multiple tables nicely(!) from PHP in Excel format?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

One of our clients is a true Excel wizard and in order to enable his highly advanced sheets to become available for others as well (editable and all), I have created a PHP version of his Excel sheets which uses a MySQL DB for storage.

I shall spare you all the technical intricacies of the sheets in question, and shall in stead suffice by stating that the generated tables use a great amount of cells and rows, where several rows have been "colspanned" and use a varierty of colours and borders as well. Good, so far no biggie, but of course the same client has now requested that the same complex HTML tables also be outputtable as Excel again. :)

Still, in itself no problem, just starting the script with the following:
<?
Header ("Content-type: application/vnd.ms-excel");
flush();
?>

And then omitting all HTML tags, but for the ones generating the HTML table (i.e. no body tags, head tags, javascripts, etc.) and for the ones within the table that use spacer graphics to force specific column/row widths/heights nicely does the trick.

Again: so far so good.

But now for the issue:
The client's request is to create three different complex tables (with three different complex lay-outs) like these, preferrably in one Excel sheet. I have yet to figure out a way to do this nicely. Just creating three tables and sending them to the same output works, but the columns will then always force the widths to the biggest width, "spun" over the columns of the three tables. This is where the issue is: the three individual tables will then no longer have nicely formatted and sized cells.

Does anyone know of a way to achieve this nicely, preferrably creating a tab per table?

Thanks in advance, and cheers,
Olaf

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux