Java将csv转化为html,将.CSV转换为HTML表格

I want to convert a .csv file to a HTML Table in jQuery. To accomplish that, I'm using a jQuery Plugin called CSVToTable.

The way I used it in my code is as follow:

I called the .CSVToTable('path/to/file.csv') on my

$("#ItemTable").CSVToTable('ItemDatabase.csv', {

loadingImage: 'img/loading.gif',

startLine: 0

});

Everything seemed to work, as well as the loading.gif (which was included in the download).

My first try was running it on the ItemDatabase.csv, which is a .csv that contains approx. 350 lines. It kept loading and loading, and after 15 minutes, I tried it with a smaller file that contains 5 lines. It made no difference.

I looked at the source of

If somebody could tell me what I'm doing wrong, that would be very helpful.

Note: I checked the file paths, and everything is initialized correctly

EDIT: For @sakir, the first 4 lines of my .csv file:

Name,Tier,Kind,Lvl,mDam,xDam,HR,MR,SD,LS,MS,XB,LB

Depressing Bow,Depressing,Bow,1,0,0,NONE,NONE,NONE,NONE,NONE,NONE,NONE

Oak Wood Bow,Basic,Bow,1,4,6,NONE,NONE,NONE,NONE,NONE,NONE,NONE

Birch Wood Bow,Basic,Bow,6,6,10,NONE,NONE,NONE,NONE,NONE,NONE,NONE

解决方案

You can not use file from the local-file system. Please copy your file on the web-server and provide the url to that file in the .CSVToTable(url_file).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值