I'm creating a simple four column, one row table. However, when the code executes I receive the following error
Table 4 rows X 1 cols> with cell (0,0) containing 'D' data error - 1 columns in data but 4 in column widths".
The code is as follows:
colwidths = (46, 76, 48, 40)
rowheights = (20)
tabledata = ('DATE ', '3-20-2016', 'FIELD # ', '1')
t = Table((tabledata), (colwidths), (rowheights))
You simply need to wrap tabledata
in another iterable to ensure its interpreted as all 5 items being on a single row, instead of 5 rows containing a single item? i.e.
tabledata = [('DATE ', '3-20-2016', 'FIELD # ', '1')]