I am having trouble understanding the coordinate system for ReportLab table styles.
According to their documentation:
The first element of each command is its identifier, the second and third arguments determine the cell coordinates of the box of cells which are affected with negative coordinates counting backwards from the limit values as in Python indexing.
The coordinates are given as (column, row) which follows the spreadsheet 'A1' model, but not the more natural (for mathematicians) 'RC' ordering. The top left cell is (0, 0) the bottom right is (-1, -1)
If the bottom right is always (-1, -1), does that mean the mid rows and columns are fractional? That doesn't seem to makes sense. Given the below example, how is the green starting at position (1,1) is the coordinate system goes from 0 to -1 and how does the second coordinate system (-2,-2) offset from the origin position?
from reportlab.lib import colors
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle
doc = SimpleDocTemplate("simple_table.pdf", pagesize=letter)
# container for the 'Flowable' objects
elements = []
data= [['00', '01', '02', '03', '04'],
['10', '11', '12', '13', '14'],
['20', '21', '22', '23', '24'],
['30', '31', '32', '33', '34']]
t=Table(data)
t.setStyle(TableStyle([('BACKGROUND',(1,1),(-2,-2),colors.green),
('TEXTCOLOR',(0,0),(1,-1),colors.red)]))
elements.append(t)
# write the document to disk
doc.build(elements)


TABLE[-1,-1]in this case is exactly the same asTABLE[3,4]in python you can access the end of the list with -1 so TABLE[-1] is the last row TABLE[-1][-1] is simply the last column of the last row (maybe i got my row/column order switched) - Joran Beasley