From: John Martin <john@me...> - 2009-10-27 18:42:44
This is actually a re-posting of a question I asked in my previous thread
"positioning text within the cells of a table with rst2pdf". It occurred to me
that perhaps the question got "lost" because I tacked it onto the end of that
other thread. If this isn't the case then I apologize for this double-posting.
The previous thread dealt with using rst2pdf to horizontally center text within
the cells of a table. 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?
Get latest updates about Open Source Projects, Conferences and News.