AlizaN
asked on
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-br eak-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-br eak-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><T D>A11</TD> </TR></TAB LE>
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>
<style type="text/css" media="print">
{
table {position:relative;page-br
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-br
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></
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>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER