How do I prevent a blank last page?

我是研究僧i 提交于 2019-12-05 08:25:37

You could add this:

table:last-of-type {
    page-break-after: auto
}

Or maybe

body > *:last-child {
    page-break-after: auto
}

I'm using ruby to create pages. I created different css to breaking and no breaking.

#publication_no_break{
/* stuff here */
page-break-after: avoid;
}

#publication_break{
/* stuff here */
page-break-after: always;
}

And on code I count every page I need to print and

<% if page != total_pages %>
< .... .... id="publication_break" >
<% else %>
< .......... id="publication_no_break">
<% end %>

You can try something like this in any language you're coding.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!