DomPDF table fixed column width and break long text

I had the same problem, I solved it thanks to @Solonka's answer.

Example:

<table border="1px" style="table-layout:fixed;">
    <tr>
        <th style="width:5%;">5%</th>
        <th style="width:10%;">10%</th>
        <th style="width:25%;">25%</th>
        <th style="width:60%;">60%</th>
    </tr>
</table>

I set width in % with table-layout:fixed and it worked fine


Not really an "answer", but my solution is switching to Snappy PDF (used the Laravel Package).
Worked like a charm, I did not even change the HTML markups.

Tags:

Html

Php

Pdf

Dompdf