?
Solved

send long table to printer

Posted on 2003-02-26
4
Medium Priority
?
202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Suggested Courses

762 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