[reportlab-users] Format cells inside table

Jakob Damgaard Møller jakobdo at gmail.com
Tue Aug 18 04:23:55 EDT 2015


Hello, this is my first post to this list, so i hope i do it right.

I try to create a table in reportlab.

data = [
  ['Firstname', 'Lastname', 'Points'],
  ['Jakob', 'Møller', '5'],
  ['Anna', 'Møller', '10'],
etc...
]

I want to format cell in colors based on result.
F.ex:
if points > 5:
  cell_color = "green"
elif point < 5:
  cell_color = "red"
else:
  cell_color = "yellow"

I have looked at this:
http://www.blog.pythonlibrary.org/2010/09/21/reportlab-tables-creating-tables-in-pdfs-with-python/
But as i understand it, the color is defined on coordinates. Cant i assign
a color when i create "data" ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20150818/d1359e80/attachment.html>


More information about the reportlab-users mailing list