开发者

Python/Django excel to html

开发者 https://www.devze.com 2023-01-31 09:24 出处:网络
Okay, so what I want to do is upload an excel sheet and display it on my website, in html. What are my options here ? I开发者_如何学编程\'ve found this xlrd module that allows you to read the data fro

Okay, so what I want to do is upload an excel sheet and display it on my website, in html. What are my options here ? I开发者_如何学编程've found this xlrd module that allows you to read the data from spreadsheets, but I don't really need that right now.


Why don't you need xlrd? It sounds like exactly what you need.

Create a Django model with a FileField that holds the spreadsheet. Then your view uses xlrd to loop over the rows and columns and put them into an HTML table. Job done.

Possible complications: multiple sheets in one Excel file; formulas; styles.


Use Zoho Viewer in your template.
For example:

<iframe src="http://viewer.zoho.com/api/urlview.do?url=http://www.iasted.org/conferences/formatting/Presentations-Tips.ppt&embed=true"
        style="width:300px; height:300px;" frameborder="0">
</iframe>
0

精彩评论

暂无评论...
验证码 换一张
取 消