the XML function solved the problem:

{{for i, row in enumerate(rows):}}
{{=DIV(XML(T(row.table_field), sanitize = True) ) }}
{{pass}}

thanks.



On Mon, Dec 30, 2013 at 3:29 AM, 黄祥 <[email protected]> wrote:

> another way around is define it on the represent for your table text field.
> e.g.
> table.table_field.represent = lambda v, r: XML(v, sanitize = True)
>
> the difference for previous code in this one you can use it for grid
> without define it again on your view.
>
> if you use string type field, yet it can be done with represent also
> e.g.
> table.website.represent = lambda website, field: \
> A(website, _title = T("View Website"), _target = "_blank", _href = "%s" %
> website)
>
> best regards,
> stifan
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/yukzpnZe4GQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to