1
我有一个表,它是建立类似如下:ReportLab的 - 添加二项为一个表格单元格
styleN = styles["Normal"]
data = []
table_row = ['ID', 'Some Information']
data.append(table_row)
table_row = []
table_row.append(Paragraph(object.ID, styleN))
table_row.append(Paragraph(object.some_information1, styleN))
data.append(table_row)
t = Table(data, (6*cm,6*cm,2*cm,2*cm,2*cm), row_heights, style=ts)
现在我要做到这一点,我可以添加到第二单元包含对象的第二段落。 some_information2。
一些或多或少的伪 - 代码来说明我想达到的目标:
table_row = []
table_row.append(Paragraph(object.ID, styleN))
info1 = Paragraph(object.some_information1, styleN)
info2 = Paragraph(object.some_information2, styleN)
info_paragraphs = info1 + info2
table_row.append(info_paragraphs)
data.append(table_row)
t = Table(data, (6*cm,6*cm,2*cm,2*cm,2*cm), row_heights, style=ts)
我想我们需要一些更多的信息,因为我不明白为什么只是做'table_row.append(info1); table_row.append(info2)'不起作用? – 2012-08-05 14:44:41
当你喜欢你建议你添加另一列,这不是我想要实现的。 – 2012-08-06 08:29:47