[reportlab-users] changed font size in table

Tom Brown brown at esteem.com
Tue Mar 1 10:49:50 EST 2005


On Monday 28 February 2005 16:06, Timothy Smith wrote:
> Tom Brown wrote:
> >I changed the font size in my tables to 8. This causes the text in the
> > cells to be misaligned vertically. Why isn't the text centered in the
> > cells?
> >
> >Here is my code to create the tables:
> >
> >  def getTable(self, data):
> >    style = [
> >      ('GRID', (0,0), (-1,-1), 0.5, colors.grey),
> >      ('FONTSIZE', (0,0), (-1, -1), 8),
> >      ('VALIGN', (0,0), (-1, -1), 'BOTTOM'),
> >    ]
> >    rowHeights = len(data) * [15]
> >    return Table(data, rowHeights=rowHeights, style=style)
> >
>
> because you have 'VALIGN' set to 'BOTTOM'

Actually, setting 'VALIGN' to 'BOTTOM' was an attempt to move the text down in 
the cells. The text rides high in the cells and setting 'VALIGN' has no 
effect. In fact, if I didn't set the rowHeights, the text would be partially 
out of the top of each cell.

Thanks,
Tom


More information about the reportlab-users mailing list