Is there a way to prevent text in a <TD> or <TH>, or more specifically, the
whole <TR></TR> from spanning page boundries when printing (@media print)?
Using IE6, I tried:
TR, TD, TH {page-break-inside:avoid;}
I don't want to use page-break-after or page-break-before because it seems
like my only options are 'always' and 'auto'. The value 'always' will
create almost a hundred pages in my case. I'd just like to page break if
the current row will span pages.
Thanks
Chris
Prevent <TD> contents from spanning pages when printin
most css printing gadgets are here:
http://www.w3schools.com/css/css_ref_print.asp
(i think it's the basic things, details can be brought otherways...
Prevent <TD> contents from spanning pages when printin
Thanks, that's a good resource, but I still don't know how to prevent cell contents from spanning pages. What does the "auto" attribute value do? It seems as if it is the same as not specifying anything for page-break-inside.
Prevent <TD> contents from spanning pages when printin
page-break-inside is not very well supported.
Auto is the default value, so basically wont make any difference in normal circumstances.
You can use page-break-before in a tr like:
<tr style="page-break-before:always"> or .pb{page-break-before:always;} <tr class="pb">
if you know which rows you want to break the page on.
If the content is dynamic, from a database etc you may have to find a way to count the content as its displayed and when it gets close to a page put the class in the next tr.
Prevent <TD> contents from spanning pages when printin
Thanks for everyone's help. I think I will just code it into my page and wait till browsers support it. No harm till then