I've looked into this some more, and I have some good news and some
bad news.
The good news is that there is a Cascading Style Sheets 2 attribute
that is designed to do exactly what you want it to. It is the
"page-break-inside" attribute, and if you use the "avoid" type it will
prevent a table from being split when printed.
Here is a page that explains the attribute and gives and example of
how it is used:
PAGE-BREAK-INSIDE attribute
http://big.faceless.org/products/report/docs/tag/atts/page-break-inside.html
This page does a good job of explaining it also:
Breaking Pages
http://www.webreview.com/tag/2000/11_24_00.shtml
Here are some other pages where it is explained, although not as
clearly:
CSS Quick Reference
http://www.tcnj.edu/~nardozza/tables3.html
Printing Tables - Section Stay Together
http://www.faqchest.com/msdn/IE-HTML/script-02/script-0205/script02051508_14617.html
CSS-2 Extensions
http://members.lycos.co.uk/lawnet/CSS2.HTM
That was the good news. The bad news is that, as the second link
above indicated, very few if any of the page-break attributes are
supported by current browsers. I tested the page-break-inside
attribute on recent versions of Internet Explorer, Mozilla and Opera,
and none of them supported it. I suspect, however, that if CSS2 grows
in popularity one of the browsers will soon be able to do what you
want.
I have thought of two workarounds:
1) Put tables on separate web pages.
2) Place tall, skinny graphics (you can make them white if you're
using a white background so it can't be seen) immediately to the left
or the right of the table, or perhaps even in the table. Most
browsers don't split graphics when printing, so this should work (I
haven't tried it).
I'm sorry I wasn't able to find a good way to do what you want. I hope
this information helps, however.
mvguy
Search strategy: I did the first search below and saw an article that
referred to the CSS2 attribute, so then I did a search for the
attribute to find out more of what I wanted.
Google search: "printing tables" split
://www.google.com/search?q=%22printing+tables%22+split&sourceid=opera&num=25&ie=utf-8&oe=utf-8
Google search: page-break-inside avoid
://www.google.com/search?num=25&hl=es&ie=UTF-8&oe=utf-8&q=page-break-inside+avoid&btnG=B%C3%BAsqueda+en+Google |