CODINGNEWS

CSV to table

Jun 3

A few days ago we published an article with a table at the TexasTribune. We usually work with tables in format CSV and then we publish them in HTML. In that case I used a random tool I found on the web. That was usually pretty straightforward, but then we needed to customize with classes and data attributes. The last task was really terrible.

We use tablesift.js for adding sorting options, so we need the siftable at the headers, we add a data-title attribute to every td in order to have a responsive table as described in here. Finally, it’s really common to add classes to every cell to improve readability of strings, integers or float numbers. All of this is a lot of work, especially if the table is big.

After that experience I came out with CSV to table which is an easy tool for converting csv documents into HTML tables, and has the capability of editing the classes once, so they can be replicated in every cell dynamically. It’s built with underscore.js and papa.parse, everything on top of middleman which is the same tool I’m using for this blog.

Special Disclaimer: Since this is a journalist-oriented tool I really don’t store anything anywhere. This webapp works only on the client side, so nothing that you can paste on it can be sent to any server. The only thing I’m tracking is the page access with Google Analytics, but it has nothing to do with the content.

comments powered by Disqus