revised the implementation to add a new keyword parameter to SQLFORM.grid td_attributes, which is a function to manipulate TD elements as they are added to rows. It is passed in the existing TD (containing only the value), the field and the row)
A trivial example to add a class attribute to the TD element is:
def td_attributes(td,field,row):
    td.add_class("w2p_%s_%s % (field.tablename,field.name))
    return td