[reportlab-users] Indenting a table with platypus
Robin Becker
robin at reportlab.com
Fri Jan 23 05:16:34 EST 2009
Roberto Alsina wrote:
> Just what the subject says.
>
> Suppose I am doing a bulleted list, and one of the items contains a table.
>
> Here's how I would wat it to look (use monospaced font ;-):
>
> * This is a table-less item
>
> * This one has a table
>
> +---------------+
> | xxxxxxxxxxxxx |
> +---------------+
>
> But right now, the table uses 100% of the page width, which looks kinda ugly.
> Any pointers?
>
> I handle this all right for paragraphs, using leftIndent, of course. Is there
> something similar for tables?
>
You can use an Indenter flowable before and after the table eg
from reportlab.platypus.doctemplate import Indenter
.....
story.append(Indenter(left=12))
story.append(myTable)
story.append(Indenter(left=-12))
That may help achieve what you want.
--
Robin Becker
More information about the reportlab-users
mailing list