我想打印一個大的HTML表格,而不是在每頁結尾處制動它的行。我使用下面的代碼,但它不工作。如何使用分頁符打印大型HTML表格?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<style>
@media print
{
table { page-break-after:auto }
tr { page-break-inside:avoid; page-break-after:auto }
td { page-break-inside:avoid; page-break-after:auto }
thead { display:table-header-group }
tfoot { display:table-footer-group }
}
</style>
<body>
<table border="1">
<?php
for($i=0;$i<50;$i++){
?>
<tr>
<td height="50" width="130">gukgu</td>
<td height="50" width="180" height="50" width="145">gukgu</td>
<td height="50" width="130">gukgu</td>
<td height="50" width="180" height="50" width="145">gukgu</td>
</tr>
<?php
}
?>
</table>
</body>
</html>
有人可以幫忙嗎?
普通傢伙。請給我一個答案。我有一個陡峭的截止日期。 – Harsh 2013-03-11 06:23:48