Skip to content

Latest commit

 

History

History
65 lines (45 loc) · 2.02 KB

README.md

File metadata and controls

65 lines (45 loc) · 2.02 KB

CSV to HTML Table

Display any CSV file as a searchable, filterable, pretty HTML table.

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
  1. Add your CSV file to the data/ folder

  2. 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.
  1. 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.