Jump to content

Advanced Css (css2 Code)


louhours
 Share

Recommended Posts

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
to
page-break-inside: after
and
page-break-inside: before
These 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...