2
在我的PHP文件,我有一个简单的表:做一个单词包装。 PHP到Excel
<head>
<style><!-- styles go here--></style>
</head>
<body>
<table border="1" align="center">
<thead>
<tr>
<th rowspan=3>Three words here</th>
<th rowspan=3>Full Name</th>
<!-- other headers ... -->
</tr>
<tr></tr>
<tr></tr>
</thead>
<tr>
<td width="50px">content</td>
<!-- other definitions ... -->
</tr>
</table>
</body>
使用头功能
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=summary.xls");
我出口我*.php
文件*.xls
格式。然后,我发现Excel
没有为表格标题做单词换行。它将元素宽度设置为<th>
而不包装它。为什么?
谢谢!
你可能想尝试[PHPExcel(http://phpexcel.codeplex.com/)。 – flowfree