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

Robin Becker reportlab-users@reportlab.com
Tue, 7 Jan 2003 16:55:03 +0000


In article <200301071716.10043.dev-pdf@smartology.nl>, Remy C. Cool <dev-pdf@smartology.nl>
writes

Interestingly I tried this and see the following

PythonWin 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32.
Portions Copyright 1994-2001 Mark Hammond (mhammond@skippinet.com.au) - see 'Help/About
PythonWin' for further copyright information.
>>> table_1_data = [['this is a cel in table_1']]
>>> from reportlab.platypus.tables import Table
>>> table_1 = Table(table_1_data)
>>> table_0_data = [['cel 1-1', 'cel 1-2', table_1],['cel 2-1', 'cel 2-2', 'cel 2-3']]
>>> from reportlab.lib.units import mm
>>> table_0 = Table(table_0_data,colWidths=3*[20*mm], rowHeights=2*[20*mm])
>>> table_0
Table(
 rowHeights=[56.692913385826778, 56.692913385826778],
 colWidths=[56.692913385826778, 56.692913385826778, 56.692913385826778],
[['cel 1-1',
    'cel 1-2',
    Table(
   rowHeights=[None],
   colWidths=[None],
  [['this is a cel in table_1']]
  ) # end table],
   ['cel 2-1', 'cel 2-2', 'cel 2-3']]
) # end table
>>>

ie no extra ''

Can you try and say what version of rl/python platform etc?
>*** 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
>
>
>
> 
>
>
>_______________________________________________
>reportlab-users mailing list
>reportlab-users@reportlab.com
>http://two.pairlist.net/mailman/listinfo/reportlab-users

-- 
Robin Becker