[reportlab-users] table in table .. ghost cel

Remy C. Cool reportlab-users@reportlab.com
Tue, 7 Jan 2003 17:16:10 +0100


*** best wishes for 2003 ***

When I create a table inside a cel of a table ... I get one empty 
ghost cel for free. How can I prevent this ghost cel?

Example:

The 3rd cel in row 1 of table_0 is table_1.

table_1_data = [['this is a cel in table_1']]
table_0_data = [['cel 1-1', 'cel 1-2', table_1],
                ['cel 2-1', 'cel 2-2', 'cel 2-3']]

table_1 = Table(table_1_data)
table_0 = Table(table_0_data, 
                colWidths=3*[20*mm], 
                rowHeights=2*[20*mm])


When I print table_0 I get:

[[u'cel 1-1', u'cel 1-2', Table(
 rowHeights=[None],
 colWidths=[None],
[[u'this is a cel in table_1']]
) # end table, ''], [u'cel 2-1', u'cel 2-2', u'cel 2-3']]

Notice the '' after # end table, 

Result is an error:
AttributeError: Table instance has no attribute '_cellvalues'

When I change colWidths to 4*[20*mm] and append one cel to the 2nd row 
.. it works. 

Any tips or solutions?

Regards,
Remy Cool