Skip to main content
Participant
July 31, 2009
Question

How to repeat table header on each page of PDF using Coldfusion

  • July 31, 2009
  • 4 replies
  • 5588 views

Hi all,

Can anybody help me in resolving this issue. The details are mentioned below.

I am generating PDF using <cfdocument> tag of Cold Fusion.
I have a header and footer to be displayed on each page. I am rendering data in a table.
If rows in the table exceed a page , and continue on the next page , I want the table headers to be repeated on each of the page.

Example :

Currently this is happening:

Page Header

Sr No

Name

Occupation

1

A

A

2

B

B

3

C

C

Page Footer : Page No 1

Page Header

4

A

A

5

B

B

6

C

C

Page Footer : Page No 2

--------------------------------------------------------------------------------------------------------------------------------------------------------

What I want is :

Page Header

Sr No

Name

Occupation

1

A

A

2

B

B

3

C

C

Page Footer : Page No 1

Page header

Sr No

Name

Occupation

4

A

A

5

B

B

6

C

C

Page Footer : Page No 2

This topic has been closed for replies.

4 replies

saravanakumars17791115
Participating Frequently
September 22, 2022

@Renu_Deshpande we acheive this by using simple css 

table { -fs-table-paginate: paginate !important; }

Participant
April 3, 2012

I have been having this same problem too. have tried several workarounds to do this, whats worse is that i have to get it to work in Google Chrome. Any help is greatly appreciated.

Thanks

August 7, 2009

I think this should work

       <cfdocumentitem type="header">
           <cfoutput>Header #ctr#</cfoutput>
       </cfdocumentitem>
       <cfdocumentitem type="footer">
           <cfoutput>Footer #ctr#</cfoutput>
       </cfdocumentitem>

Inspiring
July 31, 2009

Make the table headers part of the page header.

Participant
August 1, 2009

Hi Dan ,

Thanks for your inputs.

This way wont work beacause , am displaying other text and table both, and the table will be diplayed based on some conditions. If the conditions are true , table will be diplayed , else not.

I missed to illustrate text in the example. The scenario is something like this :

Page Header

Text .........

Table [Displayed conditionaly]

Page Footer

Please suggest me some way to do this.