Forum How do I...?

Repeated table headers with different content

cculver
When using thead to repeat my table headers on every new page that prince creates for my table, I'd like it to have "Cont'd" in the first column of the header on the new page. I have been searching the forums for the solution and the closest I could find was a promise to add it to the roadmap, but I could not find this feature listed anywhere. The post is here: http://www.princexml.com/forum/topic/947/generated-content-in-table-footers-headers.

Does anyone have any idea if this is possible as described?
mikeday
At the moment it is only possible by adding multiple table captions and using the caption-page property to control which caption appears on first vs. following pages.

We do still plan to add support for this feature, but first we have to figure out how, as CSS does not include any mechanism for changing content across pages like this.
rnkn
I've managed to approximate this by using a table-caption with no table-header-group, however the solution is not terribly elegant. I'm open to suggestions. See: http://www.princexml.com/forum/topic/2691/screenplay-dialog-formatting
rnkn
I stumbled upon this Javascript that alleges to provide custom thead and tfoot over breaking pages. I can't vouch as I don't know Javascript, but you guys might find it useful.
https://github.com/AAverin/JSUtils/blob/master/wkhtmltopdfTableSplitHack/wkhtmltopdf_tableSplitHack.js
mikeday
Looks handy, but I think it won't work in Prince as it has to inspect the table row heights, which the Prince DOM doesn't support yet.
John
hello,

I can use multiple captions. but how do you do this? show the first only on the first page, and the second on the following?

I tried with classes:

  table caption.first {
    prince-page-caption: first;
  }

  /* caption test */
  table caption.second {
    prince-page-caption: following;
  }


and counting:

  table caption:nth-of-type(1) {
    prince-page-caption: first;
  }

  /* caption test */
  table caption:nth-of-type(2) {
    prince-page-caption: following;
  }
 


This doesn't work for me...

thanks in advance,
John

Edited by John

John
Got it. I mixed up "prince-page-caption" with "prince-caption-page". Thanks :)