|
Starhugger -> Page breaks (12/6/2006 17:14:43)
|
I'm trying to create a printing style sheet for a HTML page. I want it to keep certain lines together. I'm using tables to structure blocks of content. The first row uses THEAD so that it repeats at the top of the page if there's a page break within the table. This does work. The second row uses TBODY and is divided into two columns, with a list of links in the left and a paragraph of text in the right. I want to ensure that I don't wind up with only one line of the TBODY content before a page break. At the moment, that's happening on one of the pages. Here's a sample of the printing CSS I'm using, but most of it doesn't seem to be working:
@media print {
thead td { font-size: 12pt; }
tfoot td { text-align: center; font-size: 9pt; }
thead { display: table-header-group; }
table.indextbl { orphans: 1; }
tfoot { display: table-footer-group; }
thead td, thead td { position: static; }
table.chapter thead { page-break-before: always; }
td.padded p { color: red; orphans: 3; widows: 3; }
} td.padded is the right-hand column (padding on the left side), where the paragraph of text is. Even with widows/orphans set to 3, it still insists on breaking after one line of text. I finally put the color-change in the last line just to see if ANYTHING was getting through. It does indeed change the paragraph text color, but it still leaves the one line on the previous page. I don't think any of the other instructions are working either, which I put in there a while back. (For instance, the footer is not centering.) I thought I needed the other instructions to get the THEAD sections to repeat, but they seem to be doing it anyway by virtue of using THEAD and TBODY. I've tried page-break-before and page-break-after at various places in the table, at various element levels (table, td, p, etc.). I've tried putting the print CSS in a separate file (with media="print" in the style link), as well as putting it in the same CSS that it uses for the screen. Nothing changes where the page breaks. The colour of the text will change, but nothing else seems to have any effect. It's thumbing its nose at me, I swear! I'm testing it on IE7 using the print preview feature. The client's computers use IE6. Has anyone EVER got this to work?? What am I doing wrong? Starhugger ...who's getting a headache [sm=BangHead.gif]
|
|
|
|