[reportlab-users] Vertical text in table cell

Robin Becker robin at reportlab.com
Mon Jan 31 10:21:49 EST 2011


On 31/01/2011 15:04, Arkadi Colson wrote:

> Hi,

>

> I have a methode for rotating text in a table cell but It doesn't break the line

> conform to the cell height. So the text just continues in the cell above...

> Is there a way to achieve this?

>


Hi Arkadi,

as you have shown it is possible to rotate simple text inside table cells.

The problem with splitting is that we need to know the allowed width of the
space to be used. So for example in the Table class we have mechanisms which
attempt to guess the allowed column widths before we attempt to layout the
contents. If both height and width are fixed for a given cell we don't have a
choice. Because we normally deal with horizontal text it's likely the algorithm
is strongly biassed towards width.

In your example the width of the columns is fixed. To make use of splitting with
verical text we'd need either to have a fixed row height (with variable width)
or some mechanism to get the height from width + contents.

It would be possible to put rotated paragraphs in place if the row height could
be determined.


> Example code attached

>

> Thanks!

>

> Arkadi

--
Robin Becker


More information about the reportlab-users mailing list