?
Solved

send long table to printer

Posted on 2003-02-26
4
Medium Priority
?
203 Views
Last Modified: 2008-02-26
I write a php/html/javascript project.
I have a long table (longer then a printer page).
When I send the table using window.print the printer brakes the table.  
I am looking for a tag or a way so I can devide the table to separate printed pages.

0
Comment
Question by:TellMe
  • 2
4 Comments
 
LVL 17

Expert Comment

by:dorward
ID: 8027919
Assuming you define you table headings with <th> instead of <td> then I _think_ that adding:  

th { display: table-header-group }

... to the print media style sheet will cause CSS2 compliant browsers (and IE) to print the table headings on each page.
0
 

Accepted Solution

by:
ADT earned 150 total points
ID: 8029354
Make a JavaScript to send the TABLE to the printer and when you want to insert a page break, use the CSS.

for example, the JavaScript inserts the:
        <TABLE class="nextpage">...
instead of the
        <TABLE>...
tags when you need the following to go on next sheet.

And the CSS baspage style must be something like:

table.nextpage {page-break-after:always}

You can use page-break-before the same way...

ADT
0
 

Expert Comment

by:ADT
ID: 8029357
Make a JavaScript to send the TABLE to the printer and when you want to insert a page break, use the CSS.

for example, the JavaScript inserts the:
        <TABLE class="nextpage">...
instead of the
        <TABLE>...
tags when you need the following to go on next sheet.

And the CSS nextpage style must be something like:

table.nextpage {page-break-after:always}

You can use page-break-before the same way...

ADT
0
 

Expert Comment

by:ezicoder
ID: 8033469
Hello!

<p STYLE="page-break-after: always">
  This is page 1
</p>

<p STYLE="page-break-after: always">
  This is page 2
</p>


look at specification:
http://blooberry.com/indexdot/css/properties/print/pbbefore.htm
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question