From: John M. <jo...@me...> - 2009-10-23 17:21:01
|
Roberto Alsina <ralsina <at> netmanagers.com.ar> writes: > A reportlab table can contain either a string or a flowable element. > Rst2pdf always uses flowables (for example, paragraphs). Ah, this is very useful info. I didn't know about this difference. > +------------------------+---------------------+ > | .. class:: right | .. class:: centered | > | | | > | this is right-aligned | This is centered | > +------------------------+---------------------+ Your solution worked. Thanks. I'm now trying to do the same thing, but vertically instead of horizontally. That is, by default the text in a table cell is at the top of the cell, and I'd like it instead to be vertically centered. So first I set backColor to blue in my style file, just to see the overall position of the paragraph within the cell. And it's centered both horizontally and vertically. But the text is top-aligned within the paragraph, so it looks like the solution should be analogous to the horizontal solution you provided - i.e. I need to adjust the vertical position of the text within the paragraph. I looked at the rst2pdf manual (section 8.4 Style Definition) and the reportlab manual (Chapter 6 Paragraphs) - but I didn't see a way to do this vertical alignment. The "alignment" attribute appears to be just for horizontal alignment. I also tried playing with "spaceBefore" and "borderPadding" but didn't get the desired result. Is there a way to change the vertical positioning of text within a paragraph? Thanks again, John |