PHP导出excel,t无法分割单元格,而是显示一段空格

WBOY
Release: 2016-06-06 20:43:25
Original
1588 people have browsed it

<code>    $name='down';
    header( "Cache-Control: public" );
    header( "Pragma: public" );
    header("Content-type:application/vnd.ms-excel");
    header("Content-Disposition:attachment;filename=".$name.".xlsx");
    header('Content-Type:APPLICATION/OCTET-STREAM');

    echo “ID”.“\t”;
    echo “username”.“\t”;
</code>
Copy after login
Copy after login

这样输出后,ID跟username还是在一个单元格里,只是中间空了一段空格。
\n 可以换行

回复内容:

<code>    $name='down';
    header( "Cache-Control: public" );
    header( "Pragma: public" );
    header("Content-type:application/vnd.ms-excel");
    header("Content-Disposition:attachment;filename=".$name.".xlsx");
    header('Content-Type:APPLICATION/OCTET-STREAM');

    echo “ID”.“\t”;
    echo “username”.“\t”;
</code>
Copy after login
Copy after login

这样输出后,ID跟username还是在一个单元格里,只是中间空了一段空格。
\n 可以换行

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template