How can I repeat the headings of a PdfPTable
in all the pages if the length of the table exceeds one page?
Asked
Active
Viewed 2.1k times
18

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

SKK
- 1,705
- 3
- 28
- 50
1 Answers
34
Look at setHeaderRows(int headerRows)
of PdfPTable
. Rows defined there as a header should persist on new pages.
table.setHeaderRows(1)
for the first row as a header.
See the API.

Ry-
- 218,210
- 55
- 464
- 476

Blacklight
- 3,809
- 2
- 33
- 39
-
My requirement is not to repeat heading for PdfPTable on all pages. Even if I comment this line, it still repeats. Any suggestions? – sunny_dev Nov 25 '14 at 12:04
-
I did set to 0 but to no avail. Also cudn't find anything worthwhile in linked doc. Hopeless right now.. – sunny_dev Nov 25 '14 at 15:07
-
@sunny_dev It's been quite a while, but did you ever find a solution to your problem? – Reinstate Monica -- notmaynard Dec 30 '16 at 17:10