我正在打印一个pdf格式的大报告,包括许多表格,但它通常不包含水平单元格边界。为此,我生成了cshtml
格式的报告,然后使用NRECO将其传递给pdf
现在发生的情况是,当我的表格更大时,当页面插入到另一个页面时,我的表格中不会出现水平线。
但是当我在Pdf.Currently中分页时,我希望在我的表格中有水平边框,我在Page1上有一个很长的表格,但我没有得到水平边框。
见下图:Horizontal border problem in table
<table border="0" cellpadding="0" cellspacing="0" class="width100percent">
<thead>
<tr>
<th></th>
<th></th>
<th></th>
...
...
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
...
...
</tr>
</tbody>
</table
发布于 2019-06-19 08:14:48
我一直在看你的代码,并试图重现你的问题。在CSS中,单元格元素的边框仅在左侧,因此生成包含的示例图像似乎不完整。
以下是基于您的内容构建的HTML页面的示例:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Horizontal border problem in table</title>
<style>
table.width100percent {
width: 100%;
border-width: 0;
border-spacing: 0;
}
.border-table tr td {
padding: 0 3px;
font-size: 11px;
text-transform: uppercase;
height: 18px;
font-weight: 500;
font-family: Calibri;
border-left: 1px solid #000000;
page-break-inside: avoid;
page-break-after: auto;
}
</style>
</head>
<body>
<div class="border-table">
<table class="width100percent">
此处的...full文档:https://pastebin.com/MNuwWNYG
我也尝试过在NReco上转换它,但如上所述,没有水平边框可用。生成的PDF如下所示:https://imgur.com/a/HNlpkSX
https://stackoverflow.com/questions/39125166
复制相似问题