I overwrote the css for ngx-datatable's datatable-body-cell-label
class to allow the contents to wrap when printing. However, as an unwelcome side-effect, wrapped text is getting cut-off when the page breaks. I attempted to remedy this by adding
page-break-inside: avoid;' to the css for both the
datatable-body-celland
datatable-body-cell-label` classes, but to no avail.
ngx-datatable in template:
<ngx-datatable class="material results-grid engagement-specifics" [rows]="engagementSpecifics"
[columns]="engagementSpecificsGridColumns"
[headerHeight]="30" [footerHeight]="0" [rowHeight]="70"
[rowClass]="getEngagementSpecificsRowClass"
*ngIf="showReport(['engagementSpecifics'])">
</ngx-datatable>
relevant css:
.datatable-body-cell {
@media print {
page-break-inside: avoid;
}
}
.datatable-body-cell-label {
@media print {
// allow text wrapping
white-space: normal !important;
page-break-inside: avoid;
}
}