如何在网站上显示电子表格/CSV文件
我正在尝试使用React.js在网站上显示电子表格或CSV文件 这些文件已上传到网站上,我只想将输入到网站的文件显示。我尝试过流行的Meduim.com解决方案,但它对我不起作用,并且并不能完全做我想要的。
我不知道已上传到网站的文件的内容,但我只想显示上传到网站的内容。
I am trying to display a spreadsheet or a CSV file on a website using react.js
The files are uploaded on the website and I just want to display the files inputted to the website. I have tried the popular meduim.com solution but it does not work for me, and it does not do exactly what I'm looking for.
I am not aware of the contents of the file which is uploaded to the website, but I just want to display whatever is uploaded to the website.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑:如果要解析XLS文件,则将100%需要一个库。我已经制作了一个上传器,它以前可以脱颖而出,并且自己解析XLS文件只是一个非开始者。查看这个。
您可以使用许多不同的库来执行此操作,但是如果您想自己执行此操作,则可以将CSV解析为一组数组,然后使用MAP创建HTML元素。
EDIT: If you want to parse xls file, you will 100% need a library. I've made a uploader that take excel before and parsing a xls file yourself is just a non starter. Look into this one.
There are many different library that you can use to do this but if you want to do this yourself, you can parse the csv into an array of array, then use map to create html element.