4

I have multiple div tags and a span tag inside each div(This is Header) in HTML. What I am trying to achieve is When the div breaks while printing, I want the span tag(Header) to repeat on the next page.

<div class="paragraph">
      <div class="content">
           <span class="title">Employees</span><br />
           Employee1<br />
           Employee2<br />
           Employee3<br />
           Employee4<br />
           Employee5<br />
      </div>
</div>
<div class="paragraph">
      <div class="content">
           <span class="title">Departments</span><br />
           Department1<br />
           Department2<br />
           Department3<br />
           Department4<br />
           Department5<br />
      </div>
</div>

I understand that changing HTML to tr, th, td ll solve the problem. But, I am not allowed to change the HTML. All I can do is apply properties to paragraph, content and title css classes.

So, the final output should be like below

Employees:
Employee1
Employee2
Employee3

<page break>

Employees:
Employee4
Employee5

I am strictly allowed to manipulate css only and not any HTML. I have been banging my head to the wall for 2 days and not finding a breakthrough. and the hard part is I have to make it work in IE.

Thanks

Passerby
  • 9,715
  • 2
  • 33
  • 50
ARB
  • 285
  • 1
  • 6
  • 17
  • Try this http://stackoverflow.com/questions/1360869/html-print-header-footer – Anon Mar 27 '14 at 14:29
  • @Anon Thanks for the reply. The above link talks about repeating an element on each page. But I need to repeat that element based on a condition. Repeat the span element if div breaks. I am wondering if it is even possible with CSS. – ARB Mar 27 '14 at 14:52

0 Answers0