TABLE(*[TR(*[TD(x,_style='color:%s'%colors[i][j]) for j,x in enumerate
(row)]) for i,row in enumerate(table)])

perhaps there is a better way.

On 30 Apr, 23:33, weheh <[email protected]> wrote:
> From doc:
> table=[['a','b'],['c','d']]
> print TABLE(*[TR(*rows) for rows in table])
>
> I want to change the color of the cells in the table according to
> something like this, but I don't know how to say it. This is the best
> I can come up with. Can someone offer a suggestion how to do this?
>
> colors=[['#FF0000','#00FF00'],['#0000FF','#FFFF00']]
> print TABLE(*[TR(*rows for rows in table,_style="color: %s;" % *color)
> for color in colors])
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to