vikrambalye / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

<td width> inconsistencies #376

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Here's my code
<table>
    <tr>
        <td width="50">Thistextisareallylonglonglonglonglongtext</td>
    </tr>
</table>

I expected the <td> to wrap its text since I set the width for that specific 
<td> to 50. Although, IT DOESN'T WRAP.

I've tried:
1. <td style="word-wrap: break-word" width="50">
2. Defining the width of the td by setting it on <style> td {width: 
50px}</style>
3. style = "width:50px"

NOTE: When I set the width to something longer than the usual text (I tried 
setting width="700"), you can see the <td>'s width change to 700. I just don't 
understand why the word does not wrap when I define the <td>'s width to a 
length smaller than the length of the text.

I'm currently using dompdf_0-6-0_beta2.
Windows 7 - 32 bit
Latest Version of Mozilla Firefox.

Original issue reported on code.google.com by mport9...@gmail.com on 7 Nov 2011 at 7:08

GoogleCodeExporter commented 9 years ago
Support for word-wrap:break-word was only added in r391, a little bit after 0.6 
beta 2, can you test with the SVN trunk ?

Original comment by fabien.menager on 7 Nov 2011 at 7:55

GoogleCodeExporter commented 9 years ago
This probably has to do with how table cell widths are calculated. I tried it 
inside a div and it rendered as expected:

<div style="word-wrap: break-word; width: 
50;">Thistextisareallylonglonglonglonglongtext</div>

Original comment by eclecticgeek on 8 Nov 2011 at 1:22

GoogleCodeExporter commented 9 years ago
This bug is still present in beta 3. The text breaks correctly but the table 
cell seems to calculate it's width based on the unbroken text width. 

Original comment by richa...@springload.co.nz on 16 Jul 2012 at 12:59

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 24 May 2013 at 3:00