1

How do you detect a line break in a div content?

Let's say, I have couple of divs on a page like this -

    <div id="header" style='width:500px;'> Header content </div>

    <div id="container" style='overflow:vscroll;'> dynamic content </div>

    <div style="page-break-after:always">&nbsp;</div>

When I print this page, if the content inside container div is multiple pages then the header don’t appear on the second or further pages. I need the header to show up on every page.

Any help will be very much appreciated.

imhere
  • 4,405
  • 7
  • 26
  • 25
  • How is this a PHP question? If you've research HTML printing then this is the expected behaviour. – Devraj Jul 12 '12 at 23:08
  • Would this solution work for you? http://stackoverflow.com/questions/1360869/html-print-header-footer Not ideal, but mainly a limitation of HTML and printing. – ernie Jul 12 '12 at 23:09
  • @ernie thanks for the link. Going through the answers.. – imhere Jul 12 '12 at 23:14
  • position: fixed; top: 0; helps but in my case, the content is variable not fixed. – imhere Jul 16 '12 at 21:57

1 Answers1

0

Instead of div use table with thead and tbody. Table heading will be repeated on all the pages. How to create a table with thead

Yuvaraj Loganathan
  • 781
  • 11
  • 15