我想在Windows和Linux操作系统上使用PHP将数据导出到MS Word文件。我写了下面的代码。使用PHP导出到MS-Word
header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=document_name.doc");
echo "<html>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Windows-1252\">";
echo "<body>";
echo '<table cellpadding="0" cellspacing="0" border="0" width="100%">';
echo '<tr><td>test data</td></tr>';
echo '</table>';
echo "</body>";
echo "</html>";
我有当与MS Office 2007打开微软Word文件正确无表格边框但是,如果我与MS Office 2003中打开它,然后我有一个表格边框的MS Word文档=“1”。
我该如何解决这个问题?
尝试添加style ='border:0' – Eddie
我已经尝试了通过添加'style =“border:0”'。但是,没有任何丰硕的成果。 – Pradip
如果您使用的是sytles,那么正确的格式将是'style =“border-width:0”' –