Yeah sometimes it's not a good idea to mix XML made stuff with the other
helpers, namely the TABLE helper tries to be convenient and put stuff that
you give it to him inside TDs if they aren't yet. If you really have to use
XML and TABLE use TAG to turn it into web2py helpers:
htmlrows="<tr><td>row 1 desc</td><td><a href='#'>row 1
link</a></td><td>a</td></tr>"
htmlrows+="<tr><td>row 2 desc</td><td><a href='#'>row 2
link</a></td><td>b</td></tr>"
htmlrows+="<tr><td>row 3 desc</td><td><a href='#'>row 2
link</a></td><td>c</td></tr>"
htmltablehead=THEAD(TR(TH('Column 1'),TH('links'),TH('column 3')))
htmltablebody=TBODY(TAG(XML(htmlrows)))
htmltable=TABLE(htmltablehead, htmltablebody,_class="pure-table
pure-table-bordered")
{{=htmltable}}
Also, notice that you don't need to be putting everything inside XML.
Don't forget you can always just generate this whole thing in a string and
simply call XML in the end.
Finally, wouldn't all this HTML building be better off in a view and simply
not using helpers?
--
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/d/optout.