简体   繁体   English

从php导出后如何在Excel中显示多个子列

[英]How to show multiple sub columns in Excel after export from php

I want to export table from php to Microsoft Excel with one column having 3 sub columns. 我想将表格从php导出到Microsoft Excel,其中一列包含3个子列。

Now the output I am getting in Excel does not show sub columns as part of the columns they are supposed to be. 现在,我在Excel中获得的输出不会将子列显示为应该显示的列的一部分。

for more info:- 有关更多信息:-

i have 6 main columns & 15 sub columns:- 我有6个主要栏目和15个子栏目:

  • 1st column have 4 subcolumns. 第一列有4个子列。

  • 2nd column have 3 subcolumns. 第二列有3个子列。

  • 3rd no column. 第三无列。

  • 4th column have 3 sub column. 第四列有3个子列。

  • 5th column have 2 subcolumns. 第五列有2个子列。

  • 6th have 3 sub columns. 第六有3个子列。

the output I am getting is one column with one sub column so on.. last 9 sub columns have no main column heading 我得到的输出是一列有一个子列,依此类推..最后9个子列没有主列标题

If yo just want to write an .xls you can do \\t (as tab for next cell) and \\n for new (in excel also next) line. 如果您只想编写一个.xls,则可以执行\\ t(作为下一个单元格的选项卡)和\\ n进行新行(在excel中也为下一行)。

If you want to create an .xlsx (the new office files) its like a excel-zip file you should use this library, first its a bit a studying but after a little while you can do what ever you want with php and excel http://phpexcel.codeplex.com/ 如果您要创建一个.xlsx(新的Office文件),就像使用excel-zip文件一样,则应使用此库,首先需要对其进行一些研究,但是过了一会儿,您可以使用php和excel http做任何您想做的事情://phpexcel.codeplex.com/

and maybe this helps aswell How can i write data into an excel using PHP 也许这也可以帮助我如何使用PHP将数据写入excel

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM