Control breaks inside of long table
Please use https://stackoverflow.com/questions/tagged/mpdf for all your general questions or troubleshooting! For contributing here, please see the guideline: https://github.com/mpdf/mpdf/blob/development/.github/CONTRIBUTING.md
Warning: Failing to provide necessary information may cause the issue to be closed without consideration
I found this bug / would like to have this new functionality
I have an extra long table which uses rows as sub-titles for categories. So I divide the table body in small chunks of tbody tags (which I hope is a good way for grouping.) I would love to be able to make sure the category subtitle (row) has no break after.
This is mPDF and PHP version and environment (server/fpm/cli etc) I am using
mPDF 7.0 PHP 7 Apache
This is a PHP code snippet I use
This is a HTML/CSS code snippet I use
<table>
<thead>
</thead>
<tbody style="page-break-inside: avoid;>
tr with headline
tr
tr...
<tbody>
<tbody style="page-break-inside: avoid;>
tr with headline
tr
tr...
<tbody>
<tbody style="page-break-inside: avoid;>
tr with headline
tr
tr...
<tbody>
<tbody style="page-break-inside: avoid;>
tr with headline
tr
tr...
<tbody>
</table>
Sorry, this sounds more like troubleshooting, for which we refer you to stackoverflow.
Further, with the info of your current issue description, we have to guess a lot to reproduce the case. So: please add a complete, but small as possible, example of your case. See for examples https://github.com/mpdf/mpdf/tree/development/tests/Issues
The carefully set full html example was eaten by GitHub. Tags were removed instead of encoded.
I.m.h.o it is a bug (or feature request) and not trouble shooting if tbody with a style
«tbody style="page-break-inside: avoid;"»
is not tried to be kept together-
This simplified example should not be hard to reproduce? «table»
«thead» «/thead»
«tbody style="page-break-inside: avoid;"» «tr»«td class="subheadline"»«/td»«/tr» «tr»«td class="content"»«/td»«/tr» «tr»«td class="content"»«/td»«/tr» «/tbody»
«tbody style="page-break-inside: avoid;"» «tr»«td class="subheadline"»«/td»«/tr» «tr»«td class="content"»«/td»«/tr» «tr»«td class="content"»«/td»«/tr» «/tbody»
...
«/table»
For code blocks you can use the syntax:
```php
code here
```
This would be extremely useful for large tables by splitting it into non-breaking
sections.