[英]Want to export complete html table data with formatting and grids to single cell of excel using php
This is my first post. 这是我的第一篇文章。
I want to export my html table data to single cell of excel. 我想将HTML表格数据导出到Excel的单个单元格。
If i use table tags, it throws output data to new lines or cells. 如果我使用表标签,它将把输出数据扔到新的行或单元格中。
Thanks 谢谢
Simply put the following lines on your page top: 只需将以下几行放在页面顶部:
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment;filename=myfile.xls");
header('Pragma: no-cache');
So after struggling for 3 days, found answer by my self. 因此,经过3天的奋斗,我自己找到了答案。
I used gd library functions to create big image like table and put smaller boxes (with borders) in it which gave effect of table cells. 我使用gd库函数来创建像表格这样的大图像,并在其中放置了较小的框(带有边框),从而产生了表格单元格的效果。
I used PHP-Excel 2007 to flush the image in different different cells like A1,B1,C1 . 我使用PHP-Excel 2007在不同的单元格(如A1,B1,C1)中刷新图像。
So, thank you all. 所以,谢谢大家。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.