我正在尝试创建一个包含员工信息的表。此信息正从数据库中提取。然后,我将html转换为pdf。问题是,如果有很多员工,表格会延伸到多个页面。页面的底行和下一行的顶行被截断。
下面列出了创建表的代码。我已经尝试过使用CSS分页符。它不起作用
$HTML = "<html>
<p align='center'>
<strong><em><u>{$r2['location']}</u></em></strong>
</p>
<p align='center'>
{$r2['street']}, {$r2['city']}, {$r2['state']} {$r2['zip']}
</p>
<p align='center'>
<strong>TEL: </strong>
{$r2['telephone']}
<strong>FAX:</strong>
{$r2['fax']}
</p>
<table border='1' class='print-friendly' cellspacing='0' cellpadding='0' width='737' align='center'>
<tbody>
<tr>
<td width='73' valign='top'>
<p align='center'>
<strong>EXT. #</strong>
</p>
</td>
<td width='152' valign='top'>
<h4>
ASSOCIATE
</h4>
</td>
<td width='182' valign='top'>
<h4>
POSITION/DEPT.
</h4>
</td>
<td width='154' valign='top'>
<h4>
PHONE
</h4>
</td>
<td width='176' valign='top'>
<h4>
MOBILE / PAGER
</h4>
</td>
</tr>
</tbody>
";
$HTML.= "
<tr style='page-break-inside: avoid !important;'>
<td width='73' valign='top' >
<div class='avoid' style='page-break-inside: avoid !important;'>
<p align='center'>
<strong>{$ext}</strong>
</p>
</div>
</td>
<td width='152' valign='top'>
<div class='avoid' style='page-break-inside: avoid !important;'>
<p>
{$r['name']}
</p>
</div>
</td>
<td width='182' valign='top'>
<div class='avoid' style='page-break-inside: avoid !important;'>
<p align='center'>
{$r['department']}
</p>
</div>
</td>
<td width='154' valign='top'>
<div class='avoid' style='page-break-inside: avoid !important;'>
<p align='center'>
{$telephone}
</p>
</div>
</td>
<td width='176' valign='top'>
<div class='avoid' style='page-break-inside: avoid !important;'>
<p align='center'>
{$r['mobile']}
</p>
</div>
</td>
</tr>
</html>";
}