本文整理汇总了Python中page.Page.table方法的典型用法代码示例。如果您正苦于以下问题:Python Page.table方法的具体用法?Python Page.table怎么用?Python Page.table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类page.Page
的用法示例。
在下文中一共展示了Page.table方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Structure
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import table [as 别名]
def Structure(params=None):
handle_params(params)
p = Page()
# Header
p.add_page(Header(title='Structure',
js=['static/pages/structure.js'],
css=['static/pages/structure.css']))
p.add_page(Navigation(page='structure'))
with p.div({'class': 'container-fluid'}):
schemas, schema_cols, table_data, table_cols = get_data()
with p.ul():
for schema in schemas:
with p.div({'class': 'panel panel-default'}):
with p.div({'class': 'panel-heading'}):
with p.div({'class': 'row'}):
with p.div({'class': 'col-md-2'}):
with p.a({'class': 'btn btn-success btn-xs schema-btn',
'data-toggle': 'collapse',
'href': '#%s' % schema[0],
'aria-expanded': 'false',
'aria-controls': schema[0]}):
p.content('%s - %s' % (schema[0], schema[1]))
with p.div({'class': 'col-md-10'}):
with p.ul({'class': 'list-inline'}):
for i, col in enumerate(schema_cols, 2):
with p.li():
p.content('<strong>%s</strong> %s' % (schema[i], col))
with p.div({'class': 'panel-body'}):
with p.div({'class': 'row collapse', 'id': schema[0]}):
with p.div({'class': 'col-md-2'}):
with p.div({'class': 'well'}):
with p.b():
p.content('Tables')
with p.ul():
for table in table_data[schema[0]]:
with p.li():
with p.a({'href': '#', 'onclick': 'PGUI.STRUCTURE.show_table_details(\'%s\', \'%s\'); return false;' % (schema[0], table)}):
p.content(table)
with p.div({'class': 'col-md-10'}):
for table in table_data[schema[0]]:
with p.div({'id': 'table-details-%s-%s' % (schema[0], table), 'class': 'table-details table-details-%s' % schema[0]}):
data = table_data[schema[0]][table]
with p.p():
p.content('Table size: ')
with p.b():
p.content(data['table-size'])
with p.table({'class': 'table table-condensed'}):
with p.tr():
for tc in table_cols:
with p.th():
p.content(tc)
with p.th({'id': 'col-size-header-%s-%s' % (schema[0], table)}):
with p.a({'href': '#',
'onclick': 'PGUI.STRUCTURE.get_col_size(\'%s\', \'%s\'); return false;' % (schema[0], table)}):
p.content('Get column sizes')
for row in zip(*data['column-data'].values()):
with p.tr():
for col in row:
with p.td():
p.content(col)
with p.td({'id': 'col-size-%s-%s-%s' % (schema[0], table, row[0])}):
pass
p.add_page(Footer())
return p