dompdf icon indicating copy to clipboard operation
dompdf copied to clipboard

Handling of TFOOT tag is incorrect

Open PhenX opened this issue 13 years ago • 13 comments

Original author: eclecticgeek (May 29, 2009 17:59:28)

What steps will reproduce the problem?

  1. Create an HTML document that contains a table with THEAD, TBODY, and TFOOT sections. The table should span two pages in the rendered PDF.
  2. Render the document with DOMPDF.

What is the expected output?

The PDF should contain a table that spans two pages. The THEAD and TFOOT should bookend the table on each page on which it appears.

What do you see instead?

The THEAD renders as expected, but the TFOOT is rendered as if it were a normal table row.

Additional information:

The TFOOT grouping should appear before the TBODY grouping in the HTML code as per the W3C specification: http://www.w3.org/TR/html4/struct/tables.html#h-11.2.3

We may wish to consider allowing the TFOOT grouping to be placed at the end of the table code since this is a likely scenario.

Original issue: http://code.google.com/p/dompdf/issues/detail?id=18

PhenX avatar Dec 06 '12 21:12 PhenX

From ryan.mas on July 28, 2011 21:38:50 I've gotten a lot of email requests for this. We may want to make this a priority. Has anyone looked into it yet?

PhenX avatar Dec 06 '12 21:12 PhenX

From fabien.menager on July 31, 2011 13:35:07 Nope, we didn't work on it, we try to resolve page break issues in tables for now.

PhenX avatar Dec 06 '12 21:12 PhenX

Thinking about this again after a post on the forum. The question of TFOOT support presents a particularly problematic issue where we have to back up from the bottom of the page when a footer is present. Not entirely impossible to address, perhaps the easiest method would be to "shorten" the available height when we're inside a table with a footer.

bsweeney avatar Apr 18 '13 16:04 bsweeney

So, to not open new issue about this very same problem i experience, just wanted to ask if anything is changed so far.

darkolaz avatar Mar 25 '15 17:03 darkolaz

No updates on this issue.

bsweeney avatar Mar 26 '15 00:03 bsweeney

So, just to clarify, if I want a header and footer that show up on every page, and I want to use HTML+CSS to do that, I need to use the method laid out here: http://stackoverflow.com/questions/7484318/header-in-pdf-page-using-dompdf-in-php ... as opposed to table headers and footers, correct?

ghost avatar Jun 30 '15 03:06 ghost

Hello Just for information, on dompdf 0.8.2, tfoot is working well but must be placed at the end of the table :

<table>
<thead> ... </thead>
<tbody> ... </tbody>
<tfoot> ... </tfoot>
</table>

akiuni avatar Jan 19 '18 08:01 akiuni

@akiuni not working for me even if tfoot placed after tbody for both php 5.6 anf 7.2

CM1990 avatar Jun 07 '18 03:06 CM1990

Any news for this issue?

lainosantos avatar Aug 23 '19 20:08 lainosantos

Found the same behavior here, thead repeats on every page but tfoot doesn't. I'm using a fixed div at the bottom of the page as a workaround.

Apparently the issue is in vendor\dompdf\dompdf\src\FrameDecorator\Table.php in method split() where $this->_footers is not being used.

andrefedalto avatar May 22 '20 20:05 andrefedalto

@andrefedalto I have a table who break if

is too big. So the last child of the table is not exactly as the same height of the page. Nobody as workaround to do the job?

smsfactor avatar Jun 17 '20 13:06 smsfactor

Any news?

Ouija1733 avatar Feb 29 '24 10:02 Ouija1733

nothing yet

bsweeney avatar Mar 03 '24 18:03 bsweeney