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

https://news.ycombinator.com/rss Hits: 9
Summary

CSV to HTML Table Display any CSV file as a searchable, filterable, pretty HTML table. Done in 100% JavaScript. Check out the working demo: https://csv-to-html-table.netlify.app/ 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 set your options in the CsvToHtmlTable.init() function < script > CsvToHtmlTable . init ( { csv_path : 'data/Health Clinics in Chicago.csv' , element : 'table-container' , allow_download : true , csv_options : { separator : ',' , delimiter : '"' } , datatables_options : { "paging" : false } } ) ; </ script > Available options csv_path Path to your CSV file. Path to your CSV file. element The HTML element to render your table to. Defaults to table-container The HTML element to render your table to. Defaults to allow_download if true, shows a link to download the CSV file. Defaults to false if true, shows a link to download the CSV file. Defaults to csv_options jQuery CSV configuration. Use this if you want to use a custom delimiter or separator in your input file. See their documentation. jQuery CSV configuration. Use this if you want to use a custom or in your input file. See their documentation. datatables_options DataTables configuration. See their documentation. DataTables configuration. See their documentation. custom_formatting New! A list of column indexes and custom functions to format your data (see below) Custom formatting If you want to do custom formatting for one or more column, you can pass in an array of arrays containing the index of the column and a custom function for formatting it. You can pass in multiple formatters and they will be executed in order. The custom functions must take in one parameter (the value in the cell) and return a HTML string: Example: < script > //my custom function that creates a hyperlink function format_link ( link ) { if ( link ) return "<a href='" + link + "' ...

First seen: 2025-05-22 01:23

Last seen: 2025-05-22 09:24