• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 383
  • Last Modified:

Page break when printing page-break-inside:avoid

HI, I am trying to print a document with mutliple tables. I don't want it to page break within a table when printing. (It should hold the table to the next page if necessary). Is there anyway to accomplish this? I have been playing with page-break-inside but with no results. I need it to work in all version of IE but no other browser.   This is my code:
<style type="text/css" media="print">

{

table {position:relative;page-break-inside:avoid}
td{background-Color:red;}

}
</style>

Any suggestions? Please! Thank you.

The full page is below (just a sample page with nothing on it but the <p>'s  and the table.)


<HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<HEAD>
<style type="text/css" media="print">

{

table {position:relative;page-break-inside:avoid}
td{background-Color:red;}

}
</style>

</HEAD>
<BODY>
A
A
A
A
A
AA

A
A
A
A
A
A
A
A
A
A
A
A<P>
A<P>
A<P>
A<P>

A<P>
A<P>
A<P>
A<P>

A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>

A<P>
A<P>
A<P>
A<P>

A<P>
A<P>
A<P>
A<P>

A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>

<TABLE CLASS="table" BORDER=1><Tr><TD>A8</TD></TR><Tr><TD>A9</TD></TR><Tr><TD>A10</TD></TR><Tr><TD>A11</TD></TR></TABLE>
A<P>


A<P>
A<P>
A<P>

A<P>
A<P>
A<P>
A<P>
A1<P>
A2<P>
A3<P>
A4<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>

A<P>
A<P>
A<P>
A<P>

A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
A<P>
</BODY>
</HTML>
0
AlizaN
Asked:
AlizaN
1 Solution
 
COBOLdinosaurCommented:
AFAIK the only browser that supports page-break-inside is Opera.

Trying to control the print of web pages is like trying to push a string.  If you need precision then use a pdf instead of an HTML page.

If you  don't mind the security risks of ActiveX you could try this: http://scriptx.meadroid.com/home.aspx


Cd&
0
 
AlizaNAuthor Commented:
That's great, we use them already - I'm going to check out what they have to offer. And it's good to know when we are beating our heads against a wall too, so that information is appreciated also.  Thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now