表格垂直对齐后分页
我一直在使用 page-break-after 命令在每个“分组”之后中断 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 来获取表格的 html标题显示在每个页面上。您能帮我弄清楚我需要做什么才能使这些表格位于页面顶部吗? (这是在IE8中)
I have been using the page-break-after command to break an html report after each "grouping". My problem is it is now leaving my table floating in the middle of the page. Each page is different where it puts the table, sometimes at the top of the page, sometimes in the middle and sometimes at the bottom. There is quite a bit of complexity in the HTML so I decided to take an image instead:
I will try to sum up the 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>
we are using display:table-header-group to get the table headers to show up on each page. Can you help me figure out what I need to do to get those tables to be at the top of the page? (this is in IE8)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从提供的信息无法判断。显然,CSS 问题,但不知道从哪里开始。常见问题是显示 CSS 未完全考虑到打印 CSS 以及使用 display:none;在已定义高度的 div 标签内的子元素上(删除内容但空间仍然存在。)我怀疑后者。我发现向各种元素添加背景颜色对于调试像您这样的 CSS 问题非常有帮助。
Impossible to tell from the information provided. Obviously, a CSS issue but can't tell where to begin. Common problems are the display CSS not completely accounted for in the print CSS and, using display:none; on an child element inside of a div tag that has height defined (removes the content but the space is still there.) The latter is what I suspect. I've found adding background colors to various elements very helpful in debugging CSS problems such as yours.