psliwa/PdfBundle

white space wrap in div

Closed this issue · 6 comments

Hi,

If I create 2 divs one small div, and one div with a lot of text like this:

<div style="float: left;">
    <img src="image.png" style="height: 150px;" />
</div>
<div style="float: left;">
   Here a lot of tekst, if you reproduce this you will see that this div will jump blow the first div. The behaver looks like "white-space: nowrap;" I would like it to have "white-space: wrap;"
</div>

Read the text in the second div =)

I hope you can help me out!

Thanks for reporting, this seems to be bug - I will take care of this ;)

Walkaround if you need a quick solution is to set explicity width of those div's.

I thought about this again and I have changed my mind - this is expected behavior.

Second div accommodates his width to its content that is a text. There are a lot of text so width of the div is 100% of possible width. This causes it jump below previous div even if there is a float on both divs, because first dimensions of elements are calculated, then positions. Float attribute doesn't affect elements dimensions, it affects only position.

Yes I'm sorry this is a correct behavior, forget the div floats :) this is the original problem:

What I want is an image with a float left, see exmaple jsfildde and see screenshot PDF

http://jsfiddle.net/kHa3Q/

schermafbeelding 2014-01-19 om 11 18 24

And this is unexpected behavior

Yes, this is known limitation (https://github.com/psliwa/PHPPdf#known-limitations). I will look at this soon, but this is not easy to fix and might take a lot of time.

Hmmn, damn, I would like to have it fast.. do you know a workaround?

I have created related issue in PHPPdf project, so I have closed this one.