Skip to content

derekeder/csv-to-html-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSV to HTML Table

Display any CSV file as a searchable, filterable, pretty HTML table. Done in 100% JavaScript.

Check out the working demo: http://derekeder.github.io/csv-to-html-table/

Usage

1. Clone this repository (in the command line)

git clone git@github.com:derekeder/csv-to-html-table.git
cd csv-to-html-table

2. Add your CSV file to the data/ folder

3. In index.html configure the init_table() function

<script>
  init_table({
    csv_path: 'data/Health Clinics in Chicago.csv', 
    element: 'table-container', 
    allow_download: true,
    datatable_settings: {"paging": false}
  });
</script>
  • csv_path Path to your CSV file.
  • element The HTML element to render your table to. Defaults to table-container
  • allow_download if true, shows a link to download the CSV file. Defaults to false
  • datatable_settings DataTables configuration. See their documentation.

4. Run it

You can run this by uploading it to a web server, or locally using this handy python command:

python -m SimpleHTTPServer

navigate to http://localhost:8000/

Dependencies

  • Bootstrap - Responsive HTML, CSS and Javascript framework
  • jQuery - a fast, small, and feature-rich JavaScript library
  • jQuery CSV - Parse CSV (Comma Separated Values) to Javascript arrays or dictionaries.
  • DataTables - add advanced interaction controls to any HTML table.

Errors / Bugs

If something is not behaving intuitively, it is a bug, and should be reported. Report it here: https://github.com/datamade/csv-to-html-table/issues

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Commit, do not mess with rakefile, version, or history.
  • Send a pull request. Bonus points for topic branches.

Copyright

Copyright (c) 2015 Derek Eder. Released under the MIT License.

About

🔽 Display any CSV (comma separated values) file as a searchable, filterable, pretty HTML table

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7