可能重复:
使用 PHP 生成 PDF
如何将数据从表格传输到pdf?还是有其他方法可以从表格中打印报告这是我当前的表格我希望它以 pdf 格式传输
$tbl_select_exp=mysql_query("select * from expeditures where Date between '$date1' and '$date2' and active= '1' order by Date ASC");
while($test = mysql_fetch_array($tbl_select_exp))
{
?><tr id="<?php echo $test['ExpenseID'] ?>" onclick="a(this.id); myfunction(this)">
<?php
echo"<td>".$test['Date']."</td>";
echo"<td>".$test['ORno']."</td>";
echo"<td>".$test['AccountName']."</td>";
echo"<td>".$test['Amount']."</td>";
echo "</tr>";
$test++;
}