CSV to html


CSV to html makes it easy to fetch content from csv-file(s) and put content from that file/those files and display the html(table) on a page with a single shortcode.

If you created files to use with the Visualizer Plugin, those are formatted in a specific way and if you have saved the csv-file(s) from excel, the csv looks
different. CSV to html handles both these types and it’s fairly easy to extend the plugin to use other mechanisms to identify a specific type of format of the csv-file(s).

If using more then one file, content from all files are mixed into one single table – rather then creating two tables. It’s possible to fetch information from csv files from webservers upload folder (or a subfolder to the uploadsfolder) or
from an external source (domain).

If you like the plugin, please consider donating.

Example of usage

shortcodes in post(s)/page(s)

  • [csvtohtml_create source_type=”visualizer_plugin” path=”lan” source_files=”skane.csv;smaland.csv;lappland.csv”]
  • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”excel1.csv;excel2.csv”]
  • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”*.csv”]
  • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”excel1;excel2″ debug_mode=”yes”]
  • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”excel1.csv;excel2.csv” debug_mode=”yes” fetch_lastheaders=”3″]
  • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”excel1;excel2;http://wibergsweb.se/map/sweden.csv” debug_mode=”yes”]
  • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”excel1;excel2;http://wibergsweb.se/map/sweden.csv” include_cols=”5,6,7,12-14″ eol_detection=”auto” debug_mode=”yes”]
  • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”excel1;excel2;http://wibergsweb.se/map/sweden.csv” exclude_cols=”3″ debug_mode=”yes” eol_detection=”CR/LF”]
  • [csvtohtml_create html_class=”tablesorter” source_type=”guess” path=”excelfolder” source_files=”excel1;excel2;http://wibergsweb.se/map/sweden.csv” exclude_cols=”3,7,9,11-13″]
  • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”whatever.csv” csv_delimiter=”;”]
  • [csvtohtml_create source_type=”guess” source_files=”http://wibergsweb.se/map/sweden.csv” debug_mode=”no” convert_encoding_from=”Windows-1252″ convert_encoding_to=”UTF-8″]
  • [csvtohtml_create source_type=”guess” source_files=”http://wibergsweb.se/map/sweden.csv” debug_mode=”no” convert_encoding_to=”UTF-8″]
  • [csvtohtml_create source_type=”guess” source_files=”http://wibergsweb.se/map/sweden.csv” debug_mode=”no” sort_cols=”1,2″ sort_cols_order=”desc,asc”]

Example css

  • .csvtohtml th.colset-1 {background:#ff0000 !important;}
  • .csvtohtml .even{background:#ddd;}

You can find demos at: http://wibergsweb.se/plugins/csvtohtml/

عکس‌های صفحه

  • Screenshot - using format of visualizer pluginfiles
  • Screenshot - why does not iceland show?
  • Screenshot - iceland.csv file didn't exist, now it does
  • Screenshot - show title in top left corner
  • Screenshot - Some css applied.
  • Screenshot - fetch only three last headers


This section describes how to install the plugin and get it working.

  1. Upload the plugin folder csvtohtml to the `/wp-content/plugins/’ directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress
  3. Put shortcode on the WordPress post or page you want to display it on and add css to change layout for those.


  • [csvtohtml_create] – Create the html table from specified csv-file(s)

[csvtohtml_create] attributes

  • title – set title that is shown as text in top left corner of html table (else nothing is shown there)
  • html_id – set id of this table
  • html_class – set class of this table (besides default csvtohtml – class)
  • path – relative path to uploads-folder of the wordpress – installation ( eg. /wp-content/uploads/{path} )
  • source_type – what type to use for identifying content in csv-files (valid types are guess and visualizer_plugin).
  • fetch_lastheaders – Number of specific headers to retrieve (from end)
  • source_files – file(s) to include. If using more than one file – separate them with a semicolon (;). It ‘s (from v1.0.2) possible to include a full url instead of a filename to fetch external csv files. It’s also possible (v1.1.36) to fetch files from a given path (with for example *.csv).
  • csv_delimiter – what delimiter to use in each line of csv (comma, semicolon etc)
  • exclude_cols – What columns to exclude in final html table (1,2,3,10-15 would exclude columns 1,2,3,10,11,12,13,14 and 15). If you want to remove the last column, then simply type last instead of entering a number.
  • include_cols – What columns to include in final html table (1,2,3,10-15 would display column 1,2,3,10,11,12,13,14 and 15). If include_cols is given, then exclude_cols is ignored.
  • eol_detection – CR = Carriage return, LF = Line feed, CR/LF = Carriage line and line feed, auto = autodetect. Only useful on external files. Other files are automatically autodeteced.
  • convert_encoding_from – When converting character encoding, define what current characterencoding that csv file has. (Not required, but gives best result)
  • convert_encoding_to – When converting character encoding, define what characterencoding that csv should be encoded to. (Best result of encoding is when you define both encoding from and encoding both)
  • sort_cols – Which column(s) to sort on in format nr,nr och nr-nr (example 1,2,4 or 1-2,4)
  • sort_cols_order – Which order to sort columns on (asc/desc). If you have 3 columns, you can define these with different sorting like asc,desc,asc
  • add_ext_auto – Add fileextension .csv to file (if it’s not specified in the source_files). Set to no if you don’t file extension to be added automatically.
  • float_divider – If fetching float values from csv use this character to display another “float-divider chacter” than dot (e.g. 6,3 instead of 6.3, 1,2 instead of 1.2 etc)
  • debug_mode – If set to yes then header-values and row-values would be output to screen and files like “file not found” will be displayed (otherwise it would be “silent errors”)

Default values

  • [csvtohtml_create title=”{none}” html_id=”{none}” html_class=”{none}” source_type=”visualizer_plugin” path=”{none}” fetch_lastheaders=”0″ source_files=”{none}” csv_delimiter=”,” exclude_cols=”{none} include_cols=”{none}” eol_detection=”cr/lf” convert_encoding_from=”{none}” convert_encoding_to=”{to}” sort_cols=”{none}” sort_cols_order=”asc” add_ext_auto=”yes” float_divider=”.” debug_mode=”no”]

سوالات متداول

Why don’t you include any css for the plugin?

The goal is to make the plugin work as fast as possible as expected even with the design. By not supplying any css the developer has full control over
the design.


14 می 2020
Even if the plugin tells me that it is was not tested with my WordPress version (I use latest version), it does the job very well. I play arround with my Custom CSS and voila, I have wat I want! Be careful to choose the character type, for me UTF-8 was not the good one. Test also different delimiters. The debug function tells you a lot of things. A very simple and helpfull plugin. Next step will be testing to automate the csv creation and to upload it to my server. That's another challenge...
28 فوریه 2020
The fact that this Plugin reads the CSV file directly without having to manually upload allowed me to automate several processes we were doing manually with TablePress. Saved us a lot of time. Very flexible and easy to use.
1 می 2019
It is very simple but very useful. I looked plug-in for to add live chart table in my homepage without using programming. Upload a CSV file to an appropriate place and just link to, it was possible to see the auto-refresh table data in my site by click the refresh button. I'm very satisfied with a very simple use and a feature that is not found in other table-related plug-ins.
20 نوامبر 2018
Developer was more than willing to help and even added a "missing" feature in a couple of days. Highly recommended!
3 سپتامبر 2016
Very satisfied - the author replies quickly with solutions. He was able to integrate a new feature I had recommended in a very short time. Incredible! 5/5 stars.
خواندن تمامی 8 بررسی‌

توسعه دهندگان و همکاران

“CSV to html” نرم افزار متن باز است. افراد زیر در این افزونه مشارکت کرده‌اند.

مشارکت کنندگان

ترجمه “CSV to html” به زبان شما.

علاقه‌ مند به توسعه هستید؟

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



  • Better performance when not debugging due to debugging code loaded when neccessary.
  • A new attribute has been added so float numbers fetched from csv-files could be shown with another character instead of dots (probably comma)


  • A new attribute has been added so .csv does not have to be added automatically. This could be useful when loading files from Google Drive or similar cloud based services.


  • A html-tag that (for some reason) has been inserted by mistake. It’s now corrected. Validation of html table should now validate.


  • Some missing tag in table corrected (/tbody and id-attribute(when used) corrected).


  • Debug code removed. (update to this version if you tried to install/update to 1.1.40!)


  • Changed autodetection of EOL to auto(detect) (from cr/lf) when importing CSV-files.


  • Bugfix: Display order of columns when including, excluding is fixed. (In some circumstances the display order of columns would be inccorect before)


  • CURL is not used anymore for fetching external files. Instead native WordPress HTTP API is used. Why? It’s faster and handles security (with ssl) much better. As a fallback CURL is used by the HTTP API.


  • Bugfix admin page. Important to update to this version! (if you have installed 1.1.36)


  • Help-page introduced in wordpress dashboard
  • Debugging functionality improved
  • CURL bugfix when mixing http and https – protocols.
  • Possible to disable/ignore curl if something goes wrong (even if CURL is installed)
  • Now it’s possible to use wildcards (to grab all csv-file from a specified path for example)


  • Bugfix sorting on columns when both asc and desc are used


  • Sorting of columns are now possible. It’s also possible to define different sortorders depending on which column is sorted.


  • Now it’s possible to convert(translate) characterencoding from csv to another charset (for display)


  • Now it’s possible to use “last” instead of entering a specifing column-number when excluding a column.


  • Now it’s possible to use a custom delimiter for each row in a csv file.


  • Autodetection of line endings now supported. Works automatically on local files (on server)
  • Possible to specifiy custom line endings when loading external links (when CURL is enabled)


  • Now it’s possible to specify an extra class for the table. Example: If used together with the tablesorter plugin (https://wordpress.org/plugins/table-sorter/) you can add a class called tablesorter and combine these two plugins to
    create a “tablesorted” html table generated from csv file(s) in realtime.


  • Now it’s possible to include or exclude columns in format 1,2,3 or 1-3. It’s also possible to combine these two eg. 1,2,3,7-9,13,14,15.


  • Semantic bugfix. When not defining a path an extra slash was included in the path. Now there are no extra slashes.
  • Now it’s possible to include a full url to fetch csv-files from external sources. CURL are used to fetch csv files from external sources, but if CURL is not installed, then php’s file() function is used but that requires that the server
    has allow url fopen enabled.


  • Plugin released