i have 开发者_开发百科a SQL query
family_members = db(\
    db.member.parent_membership_id==parent_id.membership_id\
    ).select(\
    db.member.first_name, db.member.parent_membership_id)
I want to display "family_members" as a table in my form.
How can i do this?
In view:
{{=family_members}}
You can follow the example I've shown you in a previous question.
Make sure to also check the documentation on the web2py website, seeing the work you are doing with this framework I would recommend to buy the web2py official manual which is really not expensive and will save you a lot of precious time. You can also read it online from the link I gave you, or download a few free chapters.
Basically you have two options,
- use the SQLTABLE
- if you want further control on the table, you can transform the result given by the above option (it's a class you can use to modify the contents), or create it entirely on your own with the HTML helpers (TABLEand so on, from thegluonlibrary).
To illustrate that a little bit:
family_members = db(...).select(...) # your rows construct
table = SQLTABLE(family_members, orderby=True, _class='sortable', _width="100%")
If you want to add a column, for example:
table[0][0].append(TH("details"))
for i, value in enumerate(table[1]):
    table[1][i].append(TD("line %d" % i, _align="center"))
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论