How to repeat table header on each page of PDF using Coldfusion
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Make the table headers part of the page header.
Copy link to clipboard
Copied
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.

Copy link to clipboard
Copied
I think this should work
<cfdocumentitem type="header">
<cfoutput>Header #ctr#</cfoutput>
</cfdocumentitem>
<cfdocumentitem type="footer">
<cfoutput>Footer #ctr#</cfoutput>
</cfdocumentitem>
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
@Renu_Deshpande we acheive this by using simple css
table { -fs-table-paginate: paginate !important; }

