Forum


Replies: 1   Views: 423
Embedhtml with a table - if content of table is too long, it will make the column too wide.
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by ralfjahr  · 26-01-2023 - 14:59

Hello,

We are rendering a table with several columns. If the content of one of these cells is a very long URL, it will take as much space as it can get, then finally "break" the URL and move the rest to the next line.

https://imgur.com/a/pqEDTK5

We are setting the column width as follows, basically setting it to a fixed pt value so that it works in docx and libreoffice-pdf:

<td width="{{ (letterWidthPt * 0.10) | round }}pt">

Thanks for helping us!

Ralf

PS: In regular HTML it would be the following but I cannot see that this works:

/** Verhindert, das Zellen zu lang werden */
.dont-break-out {

    /* These are technically the same, but use both */
    overflow-wrap: break-word;
    word-wrap: break-word;

    -ms-word-break: break-all;
    /* This is the dangerous one in WebKit, as it breaks things wherever */
    word-break: break-all;
    /* Instead use this non-standard one: */
    word-break: break-word;

    /* Adds a hyphen where the word breaks, if supported (No Blink) */
    -ms-hyphens: auto;
    -moz-hyphens: auto;
    -webkit-hyphens: auto;
    hyphens: auto;

}