louhours Posted February 26, 2009 Share Posted February 26, 2009 I have asked this before but got no reply, so I'm going to try again and hopefully get at least a yes or no to whether or not it's possible. A bonus if any of the advanced CSS users can provide me with a solution.This is an example of a extract of my CSS/HTML code <style>table{page-break-inside: avoid}</style><table border="1" cellpadding="" cellspacing="" width="600" align="center"> <TR> <td width=50%><font face="Arial" size="2">Records In</td> <td> <font face="Arial" size="2"> </td><td width=25%><font face="Arial" size="2"> </td></TR><TR> <td width=50%><font face="Arial" size="2">Matches</td> <td width=25%><font face="Arial" size="2"> </td><td width=25%><font face="Arial" size="2"> </td></TR><TR> <td width=50%><font face="Arial" size="2">Tel Matches</td><td width=25%><font face="Arial" size="2"> </td><td width=25%><font face="Arial" size="2"> </td></TR><TR> <td width=50%><font face="Arial" size="2">EX-D Matches</td><td width=25%><font face="Arial" size="2"> </td><td width=25%><font face="Arial" size="2"> </td></TR><TR> <td width=50%><font face="Arial" size="2">Unsearchable</td><td width=25%><font face="Arial" size="2"> </td><td width=25%><font face="Arial" size="2"> </td></TR></TABLE>What I'm trying to achieve with CSS2 is printer instructions, thus instructing a printer how to treat tables. I understand how it works to a point and have been able to force page breaks on every table by using the following<style>table{page-break-inside: always}</style><body>This instructs the printer to always place a table onto a new page, thus if you have 3 table then each one will be on a new page. I'm also aware you can also change the page-break-inside: always topage-break-inside: after and page-break-inside: beforeThese all follow the same rule that they will also break up the specified object (in my case tables).As what I have made is a HTML based report, it's not possible to put in fixed page breaks. As until the report is produced it's impossible to know where the page breaks would be required. This is why I thought it by using the avoid break rule, would stop tables being broken up in the print outs.As I'm new to CSS2 and still learning, from what I understand the avoid rule won't work for a whole object (meaning I think as objects such as my tables). But only work for paragraphs of text defined with flags. Is their not any way to integrate this on a larger scale so that this could maybe be wrapped still using this type of flagging system to avoid breaks within flagged areas? Link to comment Share on other sites More sharing options...
jesh Posted March 2, 2009 Share Posted March 2, 2009 From what I understand, "avoid" is typically treated as a suggestion, not a rule.This, however, explains that page-break-inside:avoid can be completely ignored in certain circumstances:http://www.w3.org/TR/CSS2/page.html#allowed-page-breaks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.