0

I created a webpage which contains five rows in a table with header and footer.The table elongates if the characters exceeds in it,but fits in a single page.I have a 250 characters limitation for each in a row.When the rows contains some 100 characters,the five rows in a table elongates and fits in a page.But when I see print preview,table splits,and one-half of 3rd row displaying in first page and 2nd half and balance two rows displaying in next page.I use separate external css for main page and another external css for print preview.How to solve?.Please help.

1 Answer 1

2

Short answer is you cannot trigger Print Preview because it's the local OS window, what you can do is before your user prints you can create a separate HTML document and use print specific stylesheet(which you are already using) for that file like this

<link rel="stylesheet" href="#" type="text/css" media="print" />

And if you want to control page break yourself use this

@media print {
    whatever {
       page-break-after:always
    }
}
Sign up to request clarification or add additional context in comments.

1 Comment

I already used that but the error occurs.How to execute my idea.That is,since I have fixed 250 characters for each row,if the texts in a row haven't complete and exceeds to next page,that row should be fully goes to 2nd page with completed rows in the first page.As I asked in my above question,that one-half of 3rd row should completely come under second page with 2 rows in the first page. How would I do that in print preview?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.