Forum Bugs

Text-overflow: ellipsis inside table not working as expected

bitone
Hi there

What I wanted to accomplish is this:



I.e. text content of a table cell should be wrapped normally. But URLs should be cut and ellipsis added.

This is the HTML/CSS I'm using, which works in the browser, but not with Prince:
<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      body {
        width: 640px;
      }
      .ellpis {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
      }
    </style>
  </head>
  <body>
    <table width="100%" border="1">
      <tr>
        <th style="width:30%;">Head1</th>
        <th style="width:30%;">Head2</th>
        <th style="width:40%;">Head3</th>
      </tr>
      <tr>
        <td>asifdoihfodsih gsodihgdoihgosi sfsgdgdgsdsrt astsrtresrts astrestrsz aet</td>
        <td>commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricie</td>
        <td style="max-width:0;">
          asifdoihfods ihgsodihgdoihgosi sfsgdgdgsdsrt astsrtresrts astrestrsz aet
          <a class="ellpis" href="#">http://very_long/url/toftheprintingand/typesettingindustry_Lorem/Ipsumhasbeen_theindustrystandarddummy/textypespecimenbook.html</a>
        </td>
      </tr>
    </table>
  </body>
</html>


It seems that Prince needs the <TD> to be a block, too. But then max-width:0 doesn't work.
I tried many things but I couldn't find a solution.

Best regards
Till

Edited by bitone

bitone
No one?



Prince handles this CSS different than ordinary browsers. Please I need some support with this.

mikeday
Sorry for the delay, perhaps applying a fixed width to the link block like "width: 200px" might be a reasonable workaround for Prince?
bitone
Hey Mikeday

Thanks for your reply!

It does the trick with "max-width:200px;" for the A tag and removing the "max-width:0;" from TD.

It's not an ideal solution, because it breaks the concept of relative sizes. But it's a workaround.

Cheers
Till