openhtmltopdf
openhtmltopdf copied to clipboard
overflow/white-space
Here's my css for a table cell:
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
The HTML:
<td colspan="3">
<span style="display: inline-block; min-width: 33.77%;">29010180A735</span>
<span>Some very large text which doesn't fit into the cell</span>
</td>
Opening the HTML in the browser results in
I know that openhtmltopdf doesn't support text-overflow: ellipsis
(GitHub issue).
When I remove it, the HTML looks like this in the browser:
But after converting to pdf with openhtmltopdf the result is as follows:
What am I doing wrong? How can I at least achieve 2.?
Example code to reproduce the issue in the openhtmltopdf sandbox:
<html>
<head>
<meta charset="UTF-8"/>
<title>Lohnabrechnung</title>
<style>
table {
table-layout: fixed;
width: 50%;
}
td {
border: 1px solid red;
}
</style>
</head>
<body>
<table>
<colgroup>
<col style="width: 26%;"/>
<col style="width: 28%;"/>
<col style="width: 23%;"/>
<col style="width: 23%;"/>
</colgroup>
<tr>
<td style="overflow: hidden; white-space:nowrap;" colspan="3">
<span style="display: inline-block; min-width: 33.77%;">29010180A735</span> <!-- No line break intended here! -->
<span>Some very large text which doesn't fit into the cell</span>
</td>
<td>Another cell</td>
</tr>
</table>
</body>
</html>