T. Christiansen
T. Christiansen

Reputation: 1038

ReportLab render right border for table cells?

There are LINEBELOW and LINEABOVE in the reportlab documentation. But i can't find a way do define right or left borders (LINELEFT,LINERIGHT).

Any suggestion how to render cells with right border only?

Edit:

I discovered 'INNERGRID' which allows me to put a border between two cells:

('INNERGRID',(0,0),(1,0),0.3*mm,(0,0,0))

This will renders a black border between the 1st and 2nd cell of the 1st row:

┌───────╥───────┐
│ cell1 ║ cell2 │    ║ = Border
└───────╨───────┘    │ = cell

But what I'm looking for is something like:

╓───────┬───────╖
║ cell1 │ cell2 ║
╙───────┴───────╜

Upvotes: 3

Views: 2799

Answers (2)

There are 'LINEBEFORE' <- left border, and 'LINEAFTER' <- right border, for this objective in ReportLab.

Documentation here: https://docs.reportlab.com/reportlab/userguide/ch7_tables/ in the section called "TableStyle Line Commands".

Upvotes: 4

Gordon Seidoh Worley
Gordon Seidoh Worley

Reputation: 8068

I do not believe there is currently support for setting the right border independently exposed by TableStyles. However, based on what you editing your question to add, you should be able to get what you want with something like this:

('GRID',(0,0),(-1,-1),0.3*mm,(0,0,0)),
('BOX',(0,0),(-1,-1),0.6*mm,(0,0,0))

That should be a thin grid between the cells and then a thicker border around the table.

Upvotes: -1

Related Questions