[reportlab-users] Table entries with VALIGN=MIDDLE are not correct

Dirk Holtwick reportlab-users@reportlab.com
Thu Nov 4 09:57:24 EST 2004


I think there is still a bug in the vAlign part of cell rendering, 
concerning table cells containing flowables. For me only 
vAlign=="BOTTOM" seems to work. I tried a bit to solve the problem, but 
didn't find a proper solution. The problem seems to have to do with the 
following lines in tables.py:

    def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, 
            if valign=='TOP':
                y = rowpos + rowheight - cellstyle.topPadding
            elif valign=='BOTTOM':
                y = rowpos+cellstyle.bottomPadding + h
                y = 

The value of "rowheight" isn't the value of the maximum rowheight. I 
propose to calculate at first the maximum value of the height of a row 
and then the TOP calculation with y = rowpos + rowheight - 
cellstyle.topPadding should work.

Maybe someone knows how to do this, I failed :-(

Yours Dirk


spirito GmbH
Dirk Holtwick (CEO)
Grünstraße 6
D-47051 Duisburg

fon: +49 203 3187778
mbx: holtwick@spirito.de
web: http://www.spirito.de

GnuPG fingerprint (http://www.gnupg.org)
A5A1 54E1 C82E 02AD 4804  0547 66F4 3FB0 C790 EBAB

More information about the reportlab-users mailing list