Item total

This commit is contained in:
zhangshine 2015-06-09 21:25:42 +08:00
parent 03b18cec2f
commit b13a80160d
4 changed files with 29 additions and 8 deletions

View file

@ -22,17 +22,21 @@ class SimpleTable(Table):
class TableWithHeader(Table):
def __init__(self, data, horizontal_align=None):
def __init__(self, data, horizontal_align=None, style=None):
Table.__init__(self, data, hAlign=horizontal_align)
style = TableStyle([
default_style = [
('INNERGRID', (0, 0), (-1, -1), .25, colors.black),
('BOX', (0, 0), (-1, -1), .25, colors.black),
('BACKGROUND', (0, 0), (-1, -len(data)), colors.lightgrey),
('ALIGN', (0, 0), (-1, -1), 'CENTER'),
('VALIGN', (0, 0), (-1, -1), 'MIDDLE')
])
self.setStyle(style)
]
if style and isinstance(style, list):
default_style.extend(style)
self.setStyle(TableStyle(default_style))
class PaidStamp(object):