1

我一直在使用 page-break-after 命令在每次“分组”后打破 html 报告。我的问题是它现在让我的表格漂浮在页面中间。每一页放置表格的位置都不同,有时在页面顶部,有时在中间,有时在底部。HTML 中有相当多的复杂性,所以我决定取一张图片: 在此处输入图像描述

我将尝试总结html

<body>
<table>
<thead>
{this is top bold box on each page}
</thead>
<tr>
<td>
<table> {this is the results table}
<thead>
{this is the headers of the "floating" results table}
</thead>
{tr's of data here}
</table>
</td>
</tr>
</table>
</body>

我们使用 display:table-header-group 来让表格标题显示在每一页上。你能帮我弄清楚我需要做什么才能让这些表格出现在页面顶部吗?(这是在 IE8 中)

4

1 回答 1

1

从提供的信息无法判断。显然,一个 CSS 问题,但不知道从哪里开始。常见问题是在打印 CSS 中未完全考虑显示 CSS,并且使用 display:none; 在定义了高度的 div 标签内的子元素上(删除内容但空间仍然存在。)后者是我怀疑的。我发现为各种元素添加背景颜色对于调试 CSS 问题(例如您的问题)非常有帮助。

于 2011-02-09T21:12:07.433 回答