flask-table.readthedocs.io - Flask Table

Example domain paragraphs

Because writing HTML is fiddly and all of your tables are basically the same.

# import things from flask_table import Table, Col # Declare your table class ItemTable(Table): name = Col('Name') description = Col('Description') # Get some objects class Item(object): def __init__(self, name, description): self.name = name self.description = description items = [Item('Name1', 'Description1'), Item('Name2', 'Description2'), Item('Name3', 'Description3')] # Or, equivalently, some dicts items = [dict(name='Name1', description='Description1'), dict(name='Name2', description='Description2'),

<table> <thead><tr><th>Name</th><th>Description</th></tr></thead> <tbody> <tr><td>Name1</td><td>Description1</td></tr> <tr><td>Name2</td><td>Description2</td></tr> <tr><td>Name3</td><td>Description3</td></tr> </tbody> </table> Or as HTML: