Search code examples
pythonreportreportlab

Reportlab table missing bottom line


I'm creating a table with reportlab and want all cells to have a border. As per the documentation:

GRID is the equivalent of applying both BOX and INNERGRID

So I'm using the style

('GRID', (0,0), (-1,-1), 1, colors.black)

This way the bottom line (the line below the last row) is missing from the table. I also tried adding a BOX around the table, but the anomaly still persists. How can I fix this?


Solution

  • The problem is caused by an image immediately below the table. The image has a white background, which made the bottom line to seemingly disappear. In fact it was covered up by the image. It looks like the Table does not respect the size of the border when calculating its size. I overcame the problem by ading a Spacer between the Table and the Image.