preload
Jun 04

Situation:
Imagine your customer has a bunch of Excel-files which he wanted to display on a website in html-form.

Problem:
What can you do here? You can write an importer to a database, or let the customer upload the excel file on a webserver and write a parser for the excel files etc. These are all non-trivial solutions for the problem that you want to easily display your information from the csv on a webpage into a table.

Solution:
I found a plugin called jquery csv2table. This is very simple to use. A CSV-file will be read asynchrounosly and a HTML-table will be created of it. So you can simply let your customer load his csv file up and the table will be created automatically. Optional support of sorting, highlighting etc. Link: http://plugins.jquery.com/project/csv2table

Example:

?View Code JAVASCRIPT
1
2
3
4
5
6
<div id="view1"></div>
<script type="text/javascript">
$(function(){
    $('#view1').csv2table('./data/Book12.csv');
});
</script>

This code will load the data from Book12.csv into the div “view1″.

Tagged with: