I'm starting now with Flask
and I came across the following question: how do I define a table class using flask_table
?
Here is my sample code and the result:
from flask_table import Table, Col
class TabelaDados(Table):
codigo = Col('Código')
nome = Col('Nome')
ip = Col('Ip')
@app.route('/dados')
def dados():
dados_pc = TI.query.all()
table = TabelaDados(dados_pc)
print(table.__html__())
return render_template('dados.html', tabela=table)
You are returning the table correctly, but wanted to include a css to the table.