2

I want to export table from php to Microsoft Excel with one column having 3 sub columns.

Now the output I am getting in Excel does not show sub columns as part of the columns they are supposed to be.

for more info:-

i have 6 main columns & 15 sub columns:-

  • 1st column have 4 subcolumns.

  • 2nd column have 3 subcolumns.

  • 3rd no column.

  • 4th column have 3 sub column.

  • 5th column have 2 subcolumns.

  • 6th have 3 sub columns.

the output I am getting is one column with one sub column so on.. last 9 sub columns have no main column heading

micstr
  • 5,080
  • 8
  • 48
  • 76

1 Answers1

0

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.

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/

and maybe this helps aswell How can i write data into an excel using PHP

Community
  • 1
  • 1
caramba
  • 21,963
  • 19
  • 86
  • 127