danfickle / danfickle/openhtmltopdf

overflow/white-space

Open
#910 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.2k
Forks
423
PR merge metrics
No merged PRs in 30d

Description

Here's my css for a table cell:

```
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
```

The HTML:

```

29010180A735
Some very large text which doesn't fit into the cell

```

Opening the HTML in the browser results in

1. ![image](https://user-images.githubusercontent.com/39371377/218456268-53d999ce-d011-4608-8265-483626169511.png)

I know that openhtmltopdf doesn't support `text-overflow: ellipsis` ([GitHub issue](https://github.com/danfickle/openhtmltopdf/issues/56)).
When I remove it, the HTML looks like this in the browser:

2. ![2023-02-13_13h22_32](https://user-images.githubusercontent.com/39371377/218457507-1fa7aba8-0364-40cb-8988-a8c257860aaf.png)

But after converting to pdf with openhtmltopdf the result is as follows:

3. ![2023-02-13_13h23_09](https://user-images.githubusercontent.com/39371377/218457695-c8dfc4c1-3ef1-4605-9589-468822b4934e.png)

What am I doing wrong? How can I at least achieve 2.?

Example code to reproduce the issue in the openhtmltopdf sandbox:

```



Lohnabrechnung

table {
table-layout: fixed;
width: 50%;
}
td {
border: 1px solid red;
}












29010180A735
Some very large text which doesn't fit into the cell

Another cell


```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.