Display any CSV file as a searchable, filterable, pretty HTML table.
Check out the working demo: http://derekeder.github.io/csv-to-html-table/
- Clone this repository (in the command line)
git clone git@github.com:derekeder/csv-to-html-table.git
cd csv-to-html-table
-
Add your CSV file to the
data/
folder -
In
index.html
configure theinit_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 totable-container
allow_download
if true, shows a link to download the CSV file. Defaults tofalse
datatable_settings
DataTables configuration. See their documentation.
- 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/
- 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.
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
- 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 (c) 2015 Derek Eder. Released under the MIT License.