Was hoping for some guidance in how to create a nicely styled table I can then view in my web browser. So far I have web scraped a page to create a .csv file and then using pandas in python I have created a table from my csv file, the code below shows my pandas code which creates my table. This code works and in my terminal I can see the results show the table in code format but I want too be able to see my table in a browser and style it nicely. I am thinking of using flask to do this but I cant get this too work, any advice would be greatly appreciated. The flask code I have written is also below but is wrong.
import pandas as pd
columns = ['cap', 'title', 'price']
df = pd.read_csv('asdawhiskey.csv', names=columns)
print(items.to_html())
set FLASK_APP=AsdaWhiskeyTable.py
$env: FLASK_APP="AsdaWhiskeyTable.py"
from flask import *
import pandas as pd
app = Flask(__name__)
@app.route("/tables")
def show_tables():
data = pd.read_csv('asdawhiskey.csv')
data.set_index(['Name'], inplace=True)
data.index.name=None
asda = data.loc[data.product=='whiskey']
return render_template('view.html', tables=[items.to_html()],
titles = ['na', 'Asda Whiskey'])
if __name__ == "__main__":
app.run(debug=True)