Discussion Locked

printing from a web browser

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

i have designed a table in html. this table contains data which is retrieved from the database. since the table is very long, when i try to print his page the page gets divided into many pages.
I want to repeat the header of the table on every page as soon as the page breaks.
i have tried doing this with the

tag. but it does not work.

can you please help.

9 replies

by jimbb

I don't think you can do this with standard HTML, and I even doubt if a script or so can handle it. The

tag just indicates that the text in that cell should be emphasized (usually in bold) and centered. It is not something like "repeat header" in a word processor.
Sorry to have to answer with bad news...;-\

Check this site for more infor about the possibilities of HTML:
http://vzone.virgin.net/sizzling.jalfrezi/iniframe.htm

Jim

by jay eckles

It may be possible to do what you're talking about with CSS (cascading style sheets). Try taking a look at the
@media print
command and the
page-break-before
page-break-after
rules (the options for which appear to be auto, always, and none). @media print says that the browser should use the rules contained within the command to style the page when it is being printed (as opposed to being rendered on screen). page-break-before and page-break-after allow you to determine whether or not a page break comes before or after a certain element of a certain class. You could have every nth row of your table have class=break, then have a CSS rule that looks like:

@media print {
.break{
page-break-before: always;
}
}

It would not surprise me at all to learn that browser support for this type of CSS is spotty at best.

Good luck.

Jay Eckles
www.jayeckles.com

by tjc

You will have to have your CGI/ASP etc program that is created the table to count up approximately 66 lines and then have it create a new table and continue from there since a browser and standard html code is not designed to do what you want.

by tjc

You will have to have your CGI/ASP etc program that is created the table to count up approximately 66 lines and then have it create a new table and continue from there since a browser and standard html code is not designed to do what you want.

This discussion is closed to new replies.