RE: [css-tables] Dropping repeated headers/footers when one content row doesn't fit

  1.  If the last row that did partially fit in the fragmentainer was a thead row (and the table was not the first element to be fragmented in the current fragmentainer), break to the next fragmentainer before the table and restart this algorithm in the new fragmentainer.

If that happens and the table was the first element in the current fragmentainer, continue fragmenting the remaining table rows normally in the next fragmentainers and abort these steps (repeated headers and footers are cancelled). Otherwise, continue to the next step.
Why abort? If the next fragmentainer is larger, you may be able to repeat there. We do want to avoid infinite loops of looking for a large enough fragmentainer somewhere down the road, but how about something like this instead:
- If that happens and the table was the first element in the current fragmentainer:
  - if all thead rows of this table have already been laid out at least once in a previous fragmentainer, skip all thead rows for this fragmentainer and otherwise apply these steps normally.
  - if some thead rows of this table have not yet been laid out in a previous fragmentainers,  skip for this fragmentainer those that already have laid out and start with those that have not and otherwise apply these steps normally.

This should ensure that:
- all thead rows are displayed at least once
- if there isn't enough room to fit them all in a single fragmentainer, they get spread in however many fragmentainers it take to get them all
- if somewhere down the line, we start having enough room, we'll start/resume thread row repetition from there.

At least that's what I'm trying to do here.

Looks fine to me. The issue is that at least in Edge if we break the thead in fragments we cannot repeat it later on. However since we only support repeated footer/header when printing and we don’t support variations in paper size our behavior is guaranteed to provide the same result as your algorithm.



  1.  If the last row that did partially fit in the fragmentainer was a tbody or tfoot row restart fragmentation in that fragmentainer with the tfoot being repeated at its bottom and therefore a reduced vertical space. If that doesn’t leave enough vertical space in the fragmentainer to contain at least partially one tbody row (or if the last row that did partially fit in the fragmentainer was a tfoot row), return to the previous fragmentation without the repeated tfoot; otherwise keep this new fragmentation. In both cases, continue to the next step.
“with the tfoot being repeated at its bottom” shouldn't that be “with **all** tfoot being repeated at its bottom”?

I assume the repeat behavior is always all or nothing, you can’t get partial repetition. If the rows are included due to normal flow, this isn’t a repetition (in short “repeated” does not include the original).


If you can either fit thead or tfoot, you should use the thead. But if you have very large thead that cannot fit but small tfoot that can, why not repeat the tfoot? I think the modified step 2 I gave above gives that result.

Fair point.

Received on Friday, 6 January 2017 21:05:22 UTC