1

I am looking for a cross-browser solution to print a table with 100+ rows, where the header repeats on every page.

I am working with ASP Classic, using VBScript, Javascript and jQuery 1.11.1 in Chrome, and the solution must work in Chrome, IE and Firefox.

This is what I have tried so far:

  1. I have tried variants of CSS:

    page-break { page-break-before:always; }

This only creates a header on the first page, and not on any other page in Chrome. (why is it still an issue, Google?) So I threw that one away.

  1. I spent the other day working with HTML DOM. The idea is to create a series of tables (i.e.: document.createElement("TABLE")), then have each table fit on 8x11 paper (landscape orientation):

    var valT = 0 var elem = document.getElementById(title); if (elem.offsetHeight / 970) { r = x.insertRow(varR); r.style.height = "30px"; valT++; } else { ....

This almost worked, if the height of the rows remain constant. Therein lays the problem: the row height does not remain constant. There is a lot of wrangling with that which resulted in frustration.

  1. Because I have the data in a JSON object, I am considering a JSON-to-PDF solution. Does one exist that will meet the requirements (100+ rows, header on every page)

Before I bang my head against the wall, can anyone offer any working solutions?

Community
  • 1
  • 1
JR.sc
  • 37
  • 6
  • Okay...I may have to [start from zero](http://stackoverflow.com/questions/19646835/print-repeating-page-headers-in-chrome). To quote [Mssr. Clarkson](http://ih1.redbubble.net/image.15801541.9408/flat,800x800,075,f.u2.jpg) "How hard can it be?" – JR.sc Jun 29 '16 at 20:32
  • I will revisit HTML DOM. Why didn't I think to use [pageBreak](http://www.w3schools.com/jsref/prop_style_pagebreakafter.asp) ? – JR.sc Jun 29 '16 at 20:48
  • Another piece is coming together. Using jQuery, instead of DOM [to measure the table's actual height](http://stackoverflow.com/questions/294250/how-do-i-retrieve-an-html-elements-actual-width-and-height). – JR.sc Jun 29 '16 at 21:00

0 Answers0