diff --git a/.gitignore b/.gitignore
index c8623b4..2f7f057 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,7 +2,6 @@
 .idea/
 *.iml
 /assets
-/.gitignore
 /index.html
 /search
 /test
diff --git a/README.md b/README.md
index 45a2171..3d23b48 100644
--- a/README.md
+++ b/README.md
@@ -4,9 +4,9 @@ The simple, easy-to-implement plugin to export HTML tables to xlsx, xls, csv, an
 
 [TableExport](https://www.travismclarke.com/tableexport/) demo **--** [TableExport + RequireJS](https://github.com/clarketm/tableexport_requirejs_app) skeleton **--** [TableExport + Flask](https://github.com/clarketm/tableexport_flask_app) skeleton.
 
-> **Notice:** In May 2017, [v3.0.0](https://github.com/clarketm/TableExport/releases/tag/v3.3.9) will be superceded by [v4.0.0](https://github.com/clarketm/TableExport/releases/tag/v4.0.0-alpha.4). Althought this is a major version bump, fear not, because all changes will be 100% backwards-compatible.
+> **Notice:** In May 2017, [v3.0.0](https://github.com/clarketm/TableExport/releases/tag/v3.3.9) will be superceded by [v4.0.0](https://github.com/clarketm/TableExport/releases/tag/v4.0.0-alpha.5). Althought this is a major version bump, fear not, because all changes will be 100% backwards-compatible.
 
-> **So why the major version bump you ask?** Well, the rationale for a major version bump is that due to a change in `TableExport`'s dependencies, in [v4.0.0](https://github.com/clarketm/TableExport/releases/tag/v4.0.0-alpha.4) forth, JQuery will no longer be a **required** dependency, instead it will be purely **optional**. So existing implementations *with* jQuery will continue to work unimpeded, now with the added benefit that new projets no longer need to rely on the overhead of such large library, unless of course you prefer jQuery or it is already part of your project. 
+> **So why the major version bump you ask?** Well, the rationale for a major version bump is that due to a change in `TableExport`'s dependencies, in [v4.0.0](https://github.com/clarketm/TableExport/releases/tag/v4.0.0-alpha.5) forth, JQuery will no longer be a **required** dependency, instead it will be purely **optional**. So existing implementations *with* jQuery will continue to work unimpeded, now with the added benefit that new projets no longer need to rely on the overhead of such large library, unless of course you prefer jQuery or it is already part of your project. 
 
 ## Getting Started
 
@@ -120,7 +120,7 @@ $("table").tableExport({
     headings: true,                     // (Boolean), display table headings (th/td elements) in the <thead>
     footers: true,                      // (Boolean), display table footers (th/td elements) in the <tfoot>
     formats: ["xls", "csv", "txt"],     // (String[]), filetype(s) for the export
-    fileName: "id",                     // (id, String), filename for the downloaded file
+    filename: "id",                     // (id, String), filename for the downloaded file
     bootstrap: true,                    // (Boolean), style buttons using bootstrap
     position: "bottom",                 // (top, bottom), position of the caption element relative to table
     ignoreRows: null,                   // (Number, Number[]), row indices to exclude from the exported file(s)
@@ -142,7 +142,7 @@ var tables = $("table").tableExport();
 ```js
 /* update */
 tables.update({
-    fileName: "newFile"     // pass in a new set of properties
+    filename: "newFile"     // pass in a new set of properties
 });
 
 /* reset */
diff --git a/bower.json b/bower.json
index 7dcb30a..b529338 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
 {
   "name": "tableexport.js",
-  "version": "4.0.0-alpha.4",
+  "version": "4.0.0-alpha.5",
   "authors": [
     "clarketm <travis.m.clarke@gmail.com>"
   ],
diff --git a/dist/css/tableexport.css b/dist/css/tableexport.css
index 29b0114..233a601 100644
--- a/dist/css/tableexport.css
+++ b/dist/css/tableexport.css
@@ -1,5 +1,5 @@
 /*!
- * TableExport.js 4.0.0-alpha.4 (https://www.travismclarke.com)
+ * TableExport.js 4.0.0-alpha.5 (https://www.travismclarke.com)
  * Copyright 2017 Travis Clarke
  * Licensed under the MIT license
  */
diff --git a/dist/css/tableexport.min.css b/dist/css/tableexport.min.css
index 0fd03a4..96ae58a 100644
--- a/dist/css/tableexport.min.css
+++ b/dist/css/tableexport.min.css
@@ -1,5 +1,5 @@
 /*!
- * TableExport.js 4.0.0-alpha.4 (https://www.travismclarke.com)
+ * TableExport.js 4.0.0-alpha.5 (https://www.travismclarke.com)
  * Copyright 2017 Travis Clarke
  * Licensed under the MIT license
  */.top{caption-side:top}.bottom{caption-side:bottom}.button-default,.button-default:active,.button-default:focus,.button-default:hover{text-decoration:none}.button-default{font:700 12px sans-serif;color:#222;cursor:pointer;padding:5px;margin:5px}.button-default.csv:before,.button-default.txt:before,.button-default.xls:before,.button-default.xlsx:before{content:none}.csv,.txt,.xls,.xlsx{margin:4px 0}.csv:before,.txt:before,.xls:before,.xlsx:before{margin-right:10px;padding:11px 15px 12px;box-shadow:1px 1px 2px rgba(0,0,0,.2)}.xlsx:before{content:"";background:#006400 url(../img/xlsx.svg) no-repeat center}.xls:before{content:"";background:green url(../img/xls.svg) no-repeat center}.csv:before{content:"";background:#00f url(../img/csv.svg) no-repeat center}.txt:before{content:"";background:purple url(../img/txt.svg) no-repeat center}
\ No newline at end of file
diff --git a/dist/js/tableexport.js b/dist/js/tableexport.js
index 846f1b9..d6fd128 100644
--- a/dist/js/tableexport.js
+++ b/dist/js/tableexport.js
@@ -1,5 +1,5 @@
 /*!
- * TableExport.js 4.0.0-alpha.4 (https://www.travismclarke.com)
+ * TableExport.js 4.0.0-alpha.5 (https://www.travismclarke.com)
  * Copyright 2017 Travis Clarke
  * Licensed under the MIT license
  */
@@ -15,7 +15,7 @@
         // Browser globals
         factory(root, root.jQuery, root.Blob, root.saveAs, root.XLSX);
     }
-}(this, function (exports, $, Blob, saveAs, XLSX) {
+}(this || window, function (exports, $, Blob, saveAs, XLSX) {
         'use strict';
         /**
          * TableExport main plugin constructor
@@ -41,6 +41,9 @@
                 ignoreCols = self.settings.ignoreCols instanceof Array ? self.settings.ignoreCols : [self.settings.ignoreCols],
                 ignoreCSS = self.settings.ignoreCSS instanceof Array ? self.settings.ignoreCSS.join(", ") : self.settings.ignoreCSS,
                 emptyCSS = self.settings.emptyCSS instanceof Array ? self.settings.emptyCSS.join(", ") : self.settings.emptyCSS,
+                formatValue = TableExport.prototype.formatValue.bind(this, self.settings.trimWhitespace),
+                getType = TableExport.prototype.getType,
+                store = new TableExport.prototype.LocalStorage.getInstance(),
                 bootstrapClass, bootstrapTheme, bootstrapSpacing;
 
             if (self.settings.bootstrap) {
@@ -97,10 +100,18 @@
                                                     break;
                                                 }
                                             }
-                                            return new Array(total).concat($(val).text());
+                                            return new Array(total).concat({
+                                                v: formatValue(val.textContent),
+                                                t: getType(val.className)
+                                            });
                                         }
-                                        return val.textContent;
+                                        return {
+                                            v: formatValue(val.textContent),
+                                            t: getType(val.className)
+                                        };
                                     });
+                                }).map(function (val, ir) {
+                                    return [].concat.apply([], val);
                                 }),
                                 dataObject = TableExport.prototype.escapeHtml(
                                     JSON.stringify({
@@ -148,10 +159,18 @@
                                                     break;
                                                 }
                                             }
-                                            return new Array(total).concat($(val).text());
+                                            return new Array(total).concat({
+                                                v: formatValue(val.textContent),
+                                                t: getType(val.className)
+                                            });
                                         }
-                                        return val.textContent;
+                                        return {
+                                            v: formatValue(val.textContent),
+                                            t: getType(val.className)
+                                        };
                                     });
+                                }).map(function (val, ir) {
+                                    return [].concat.apply([], val);
                                 }),
                                 dataObject = TableExport.prototype.escapeHtml(
                                     JSON.stringify({
@@ -178,9 +197,14 @@
                                         if (_hasClass(val, emptyCSS)) {
                                             return " "
                                         }
-                                        return val.textContent;
+                                        return {
+                                            v: formatValue(val.textContent),
+                                            t: getType(val.className)
+                                        };
                                     }).join(colD);
-                                }).join(rdel),
+                                }).join(rdel).map(function (val, ir) {
+                                    return [].concat.apply([], val);
+                                }),
                                 dataObject = TableExport.prototype.escapeHtml(
                                     JSON.stringify({
                                         data: dataURL,
@@ -206,7 +230,7 @@
                                         if (_hasClass(val, emptyCSS)) {
                                             return " "
                                         }
-                                        return '"' + val.textContent.replace(/"/g, '""') + '"';
+                                        return '"' + formatValue(val.textContent.replace(/"/g, '""')) + '"';
                                     }).join(colD);
                                 }).join(rdel),
                                 dataObject = TableExport.prototype.escapeHtml(
@@ -234,7 +258,7 @@
                                         if (_hasClass(val, emptyCSS)) {
                                             return " "
                                         }
-                                        return val.textContent;
+                                        return formatValue(val.textContent);
                                     }).join(colD);
                                 }).join(rdel),
                                 dataObject = TableExport.prototype.escapeHtml(
@@ -258,6 +282,10 @@
                     }
                 );
 
+                /**
+                 * Initializes table caption with export buttons
+                 * @param exportButton {HTMLButtonElement}
+                 */
                 function checkCaption(exportButton) {
                     var caption = el.querySelectorAll('caption:not(.head)');
                     if (caption.length) {
@@ -270,9 +298,17 @@
                     }
                 }
 
+                /**
+                 * Creates file export buttons
+                 * @param dataObject {JSON}
+                 * @param myContent {String}
+                 * @param myClass {String}
+                 */
                 function createObjButton(dataObject, myContent, myClass) {
                     var exportButton = document.createElement('button');
-                    exportButton.setAttribute('data-fileblob', dataObject);
+                    var uuid = _uuid();
+                    exportButton.setAttribute('data-fileblob', uuid);
+                    store.setItem(uuid, dataObject, true);
                     exportButton.className = bootstrapClass + bootstrapTheme + myClass;
                     exportButton.textContent = myContent;
                     checkCaption(exportButton);
@@ -281,7 +317,7 @@
 
             var exportButton = document.querySelectorAll("button[data-fileblob]");
             _on(exportButton, "click", function () {
-                var object = JSON.parse(this.getAttribute("data-fileblob")),
+                var object = JSON.parse(store.getItem(this.getAttribute("data-fileblob"))),
                     data = object.data,
                     filename = object.filename,
                     mimeType = object.mimeType,
@@ -297,7 +333,7 @@
              * Version.
              * @memberof TableExport.prototype
              */
-            version: "4.0.0-alpha.4",
+            version: "4.0.0-alpha.5",
             /**
              * Default plugin options.
              * @memberof TableExport.prototype
@@ -309,10 +345,11 @@
                 filename: "id",                             // (id, String), filename for the downloaded file, (default: "id")
                 bootstrap: true,                            // (Boolean), style buttons using bootstrap, (default: true)
                 position: "bottom",                         // (top, bottom), position of the caption element relative to table, (default: "bottom")
-                ignoreRows: null,                           // (Number, Number[]), row indices to exclude from the exported file (default: null)
-                ignoreCols: null,                           // (Number, Number[]), column indices to exclude from the exported file (default: null)
-                ignoreCSS: ".tableexport-ignore",           // (selector, selector[]), selector(s) to exclude cells from the exported file (default: ".tableexport-ignore")
-                emptyCSS: ".tableexport-empty"              // (selector, selector[]), selector(s) to replace cells with an empty string in the exported file (default: ".tableexport-empty")
+                ignoreRows: null,                           // (Number, Number[]), row indices to exclude from the exported file(s) (default: null)
+                ignoreCols: null,                           // (Number, Number[]), column indices to exclude from the exported file(s) (default: null)
+                ignoreCSS: ".tableexport-ignore",           // (selector, selector[]), selector(s) to exclude cells from the exported file(s) (default: ".tableexport-ignore")
+                emptyCSS: ".tableexport-empty",             // (selector, selector[]), selector(s) to replace cells with an empty string in the exported file(s) (default: ".tableexport-empty")
+                trimWhitespace: false                       // (Boolean), remove all leading/trailing newlines, spaces, and tabs from cell text in the exported file(s) (default: false)
             },
             /**
              * Character set (character encoding) of the HTML.
@@ -387,6 +424,33 @@
                 mimeType: "text/plain",
                 fileExtension: ".txt"
             },
+            /**
+             * Cell-types override and assertion configuration
+             * @memberof TableExport.prototype
+             */
+            types: {
+                string: {
+                    defaultClass: "tableexport-string"
+                },
+                number: {
+                    defaultClass: "tableexport-number",
+                    assert: function (v) {
+                        return !isNaN(v.replace(/,/g, ''));
+                    }
+                },
+                boolean: {
+                    defaultClass: "tableexport-boolean",
+                    assert: function (v) {
+                        return v.toLowerCase() === 'true' || v.toLowerCase() === 'false';
+                    }
+                },
+                date: {
+                    defaultClass: "tableexport-date",
+                    assert: function (v) {
+                        return !isNaN(Date.parse(v))
+                    }
+                }
+            },
             /**
              * Escapes special characters with HTML entities
              * @memberof TableExport.prototype
@@ -398,6 +462,35 @@
                     return TableExport.prototype.entityMap[s];
                 });
             },
+            /**
+             * Removes leading/trailing whitespace from cell string
+             * @param isTrimWhitespace {Boolean}
+             * @param string {String}
+             * @returns {String} trimmed string
+             */
+            formatValue: function (isTrimWhitespace, string) {
+                return isTrimWhitespace ? string.trim() : string;
+            },
+            /**
+             * Get cell data-type
+             * @param string {String}
+             * @returns {String} data-type
+             */
+            getType: function (string) {
+                if (!string) return '';
+                var types = TableExport.prototype.types;
+                if (~string.indexOf(types.string.defaultClass)) {
+                    return 's';
+                } else if (~string.indexOf(types.number.defaultClass)) {
+                    return 'n';
+                } else if (~string.indexOf(types.boolean.defaultClass)) {
+                    return 'b';
+                } else if (~string.indexOf(types.date.defaultClass)) {
+                    return 'd';
+                } else {
+                    return '';
+                }
+            },
             /**
              * Formats datetimes for compatibility with Excel
              * @memberof TableExport.prototype
@@ -414,29 +507,33 @@
              * Creates an Excel spreadsheet from a data string
              * @memberof TableExport.prototype
              * @param data {String}
-             * @returns {Number} epoch time
              */
             createSheet: function (data) {
                 var ws = {};
                 var range = {s: {c: 10000000, r: 10000000}, e: {c: 0, r: 0}};
-                for (var R = 0; R != data.length; ++R) {
-                    for (var C = 0; C != data[R].length; ++C) {
+                var types = TableExport.prototype.types;
+                for (var R = 0; R !== data.length; ++R) {
+                    for (var C = 0; C !== data[R].length; ++C) {
                         if (range.s.r > R) range.s.r = R;
                         if (range.s.c > C) range.s.c = C;
                         if (range.e.r < R) range.e.r = R;
                         if (range.e.c < C) range.e.c = C;
-                        var cell = {v: data[R][C]};
-                        if (cell.v == null) continue;
+                        var cell = data[R][C];
+                        if (!cell || !cell.v) continue;
                         var cell_ref = XLSX.utils.encode_cell({c: C, r: R});
 
-                        if (typeof cell.v === 'number') cell.t = 'n';
-                        else if (typeof cell.v === 'boolean') cell.t = 'b';
-                        else if (cell.v instanceof Date) {
+                        if (!cell.t) {
+                            if (types.number.assert(cell.v)) cell.t = 'n';
+                            else if (types.boolean.assert(cell.v)) cell.t = 'b';
+                            else if (types.date.assert(cell.v)) cell.t = 'd';
+                            else cell.t = 's';
+                        }
+
+                        if (cell.t === 'd') {
                             cell.t = 'n';
                             cell.z = XLSX.SSF._table[14];
                             cell.v = this.dateNum(cell.v);
                         }
-                        else cell.t = 's';
 
                         ws[cell_ref] = cell;
                     }
@@ -462,7 +559,7 @@
             string2ArrayBuffer: function (s) {
                 var buf = new ArrayBuffer(s.length);
                 var view = new Uint8Array(buf);
-                for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
+                for (var i = 0; i !== s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
                 return buf;
             },
             /**
@@ -474,7 +571,7 @@
              * @param extension {String} file extension
              */
             export2file: function (data, mime, name, extension) {
-                if (XLSX && extension.substr(0, 4) == ".xls") {
+                if (XLSX && extension.substr(0, 4) === (".xls")) {
                     var wb = new this.Workbook(),
                         ws = this.createSheet(data);
 
@@ -494,31 +591,62 @@
                     name + extension, true);
             },
             /**
-             * Updates the plugin instance with new/updated options
-             * @param options {Object} TableExport configuration options
-             * @returns {TableExport} updated TableExport instance
-             */
-            update: function (options) {
-                return new TableExport(this.selectors, _extend({}, this.settings, options), true);
-            },
-            /**
-             * Reset the plugin instance to its original state
-             * @returns {TableExport} original TableExport instance
-             */
-            reset: function () {
-                return new TableExport(this.selectors, this.settings, true);
-            },
-            /**
-             * Remove the instance (i.e. caption containing the export buttons)
+             * LocalStorage main interface constructor
+             * @memberof TableExport.prototype
+             * @constructor
              */
-            remove: function () {
-                this.selectors.each(function () {
-                    var caption = this.querySelectorAll('caption:not(.head)');
-                    caption.parentNode.removeChild(caption);
-                });
+            LocalStorage: function () {
+                this.type = 'localStorage';
+                this.store = exports[this.type];
+                this.namespace = 'te';
+                this.getKey = function (key) {
+                    return this.namespace + key;
+                };
+                this.setItem = function (_key, value, overwrite) {
+                    var key = this.getKey(_key);
+                    if (this.exists(key) && !overwrite) {
+                        return;
+                    }
+                    return this.store.setItem(key, value);
+                };
+                this.getItem = function (_key) {
+                    var key = this.getKey(_key);
+                    return this.store.getItem(key);
+                };
+                this.exists = function (_key) {
+                    var key = this.getKey(_key);
+                    return this.store.getItem(key) !== null;
+                };
+                this.removeItem = function (_key) {
+                    var key = this.getKey(_key);
+                    return this.store.removeItem(key);
+                };
+                this.error = function (message) {
+                    return new Error('unknown error occurred', message);
+                };
+            }
+        };
+
+        var _store = TableExport.prototype.LocalStorage;
+        _store._instance = null;
+        _store.getInstance = function () {
+            if (!_store._instance) {
+                _store._instance = new _store();
             }
+            return _store._instance;
         };
 
+        function _uuid() {
+            function s4() {
+                return Math.floor((1 + Math.random()) * 0x10000)
+                    .toString(16)
+                    .substring(1);
+            }
+
+            return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+                s4() + '-' + s4() + s4() + s4();
+        }
+
         function _extend() {
             var args = arguments;
             for (var i = 1; i < args.length; i++)
@@ -559,7 +687,7 @@
             }
         }
 
-        exports.default = exports.TableExport = TableExport;
+        return exports.default = exports.TableExport = TableExport;
 
     }
 ));
diff --git a/dist/js/tableexport.min.js b/dist/js/tableexport.min.js
index 7043dfc..75109ec 100644
--- a/dist/js/tableexport.min.js
+++ b/dist/js/tableexport.min.js
@@ -1,6 +1,6 @@
 /*!
- * TableExport.js 4.0.0-alpha.4 (https://www.travismclarke.com)
+ * TableExport.js 4.0.0-alpha.5 (https://www.travismclarke.com)
  * Copyright 2017 Travis Clarke
  * Licensed under the MIT license
  */
-!function(t,e){"function"==typeof define&&define.amd?define(["exports","jquery","blobjs","file-saverjs","xlsx-js"],e):"object"==typeof exports&&"string"!=typeof exports.nodeName?e(exports,require("jquery"),require("blobjs"),require("file-saverjs"),require("xlsx-js")):e(t,t.jQuery,t.Blob,t.saveAs,t.XLSX)}(this,function(t,e,n,o,r){"use strict";function s(){for(var t=arguments,e=1;e<t.length;e++)for(var n in t[e])t[e].hasOwnProperty(n)&&(t[0][n]=t[e][n]);return t[0]}function i(t){return[].slice.call(t)}function a(t,e,n){for(var o=0;o<t.length;++o)t[o].addEventListener(e,n,!1)}function l(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.cls)}var p=function(t,n,o){var f=this;f.settings=o?n:s({},p.prototype.defaults,n),f.selectors=i(t);var u,c,x,y=p.prototype.rowDel,m=f.settings.ignoreRows instanceof Array?f.settings.ignoreRows:[f.settings.ignoreRows],d=f.settings.ignoreCols instanceof Array?f.settings.ignoreCols:[f.settings.ignoreCols],h=f.settings.ignoreCSS instanceof Array?f.settings.ignoreCSS.join(", "):f.settings.ignoreCSS,g=f.settings.emptyCSS instanceof Array?f.settings.emptyCSS.join(", "):f.settings.emptyCSS;f.settings.bootstrap?(u=p.prototype.bootstrap[0]+" ",c=p.prototype.bootstrap[1]+" ",x=p.prototype.bootstrap[2]+" "):(u=p.prototype.defaultButton+" ",c=x=""),f.selectors.forEach(function(t){function n(e){var n=t.querySelectorAll("caption:not(.head)");n.length?n[0].appendChild(e):(n=document.createElement("caption"),n.className=x+f.settings.position,n.appendChild(e),t.insertBefore(n,t.firstChild))}function s(t,e,o){var r=document.createElement("button");r.setAttribute("data-fileblob",t),r.className=u+c+o,r.textContent=e,n(r)}var a=t.querySelectorAll("caption:not(.head)");o&&a.parentNode.removeChild(a);var b=i(t.querySelectorAll("tbody > tr")),b=f.settings.headings?i(t.querySelectorAll("thead > tr")).concat(b):b,b=f.settings.footers?i(t.querySelectorAll("tfoot > tr")).concat(b):b,v=f.settings.headings?t.querySelectorAll("thead > tr").length:0,S="id"===f.settings.filename?t.getAttribute("id")?t.getAttribute("id"):p.prototype.defaultFilename:f.settings.filename,C={xlsx:function(t,n){var o={},r=i(b).map(function(t,n){if(!~m.indexOf(n-v)&&!l(t,h)){var r=t.querySelectorAll("th, td");return i(r).map(function(t,r){if(!~d.indexOf(r)&&!l(t,h)){if(l(t,g))return" ";if(t.hasAttribute("colspan")&&(o[n]=o[n]||{},o[n][r+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var s=1;s<t.getAttribute("rowspan");s++)o[n+s]=o[n+s]||{},o[n+s][r]=1;if(o[n]){for(var i=r+1,a=0,p=0,s=0;s<=Math.max.apply(Math,Object.keys(o[n]))&&(o[n][s]?a=p>=r?a+o[n][s]:a:p++,p!==i);s++);return new Array(a).concat(e(t).text())}return t.textContent}})}}),a=p.prototype.escapeHtml(JSON.stringify({data:r,filename:n,mimeType:p.prototype.xlsx.mimeType,fileExtension:p.prototype.xlsx.fileExtension})),f=p.prototype.xlsx.buttonContent,u=p.prototype.xlsx.defaultClass;s(a,f,u)},xlsm:function(t,n){var o={},r=i(b).map(function(t,n){if(!~m.indexOf(n-v)&&!l(t,h)){var r=t.querySelectorAll("th, td");return i(r).map(function(t,r){if(!~d.indexOf(r)&&!l(t,h)){if(l(t,g))return" ";if(t.hasAttribute("colspan")&&(o[n]=o[n]||{},o[n][r+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var s=1;s<t.getAttribute("rowspan");s++)o[n+s]=o[n+s]||{},o[n+s][r]=1;if(o[n]){for(var i=r+1,a=0,p=0,s=0;s<=Math.max.apply(Math,Object.keys(o[n]))&&(o[n][s]?a=p>=r?a+o[n][s]:a:p++,p!==i);s++);return new Array(a).concat(e(t).text())}return t.textContent}})}}),a=p.prototype.escapeHtml(JSON.stringify({data:r,filename:n,mimeType:p.prototype.xls.mimeType,fileExtension:p.prototype.xls.fileExtension})),f=p.prototype.xls.buttonContent,u=p.prototype.xls.defaultClass;s(a,f,u)},xls:function(t,e){var n=p.prototype.xls.separator,o=i(b).map(function(t,e){if(!~m.indexOf(e-v)&&!l(t,h)){var o=t.querySelectorAll("th, td");return i(o).map(function(t,e){if(!~d.indexOf(e)&&!l(t,h))return l(t,g)?" ":t.textContent}).join(n)}}).join(t),r=p.prototype.escapeHtml(JSON.stringify({data:o,filename:e,mimeType:p.prototype.xls.mimeType,fileExtension:p.prototype.xls.fileExtension})),a=p.prototype.xls.buttonContent,f=p.prototype.xls.defaultClass;s(r,a,f)},csv:function(t,e){var n=p.prototype.csv.separator,o=i(b).map(function(t,e){if(!~m.indexOf(e-v)&&!l(t,h)){var o=t.querySelectorAll("th, td");return i(o).map(function(t,e){if(!~d.indexOf(e)&&!l(t,h))return l(t,g)?" ":'"'+t.textContent.replace(/"/g,'""')+'"'}).join(n)}}).join(t),r=p.prototype.escapeHtml(JSON.stringify({data:o,filename:e,mimeType:p.prototype.csv.mimeType,fileExtension:p.prototype.csv.fileExtension})),a=p.prototype.csv.buttonContent,f=p.prototype.csv.defaultClass;s(r,a,f)},txt:function(t,e){var n=p.prototype.txt.separator,o=i(b).map(function(t,e){if(!~m.indexOf(e-v)&&!l(t,h)){var o=t.querySelectorAll("th, td");return i(o).map(function(t,e){if(!~d.indexOf(e)&&!l(t,h))return l(t,g)?" ":t.textContent}).join(n)}}).join(t),r=p.prototype.escapeHtml(JSON.stringify({data:o,filename:e,mimeType:p.prototype.txt.mimeType,fileExtension:p.prototype.txt.fileExtension})),a=p.prototype.txt.buttonContent,f=p.prototype.txt.defaultClass;s(r,a,f)}};f.settings.formats.forEach(function(t){!(!r||"xls"!==t)&&(t="xlsm"),!r&&"xlsx"===t&&(t=null),t&&C[t](y,S)})});var b=document.querySelectorAll("button[data-fileblob]");return a(b,"click",function(){var t=JSON.parse(this.getAttribute("data-fileblob")),e=t.data,n=t.filename,o=t.mimeType,r=t.fileExtension;p.prototype.export2file(e,o,n,r)}),f};if(p.prototype={version:"4.0.0-alpha.4",defaults:{headings:!0,footers:!0,formats:["xls","csv","txt"],filename:"id",bootstrap:!0,position:"bottom",ignoreRows:null,ignoreCols:null,ignoreCSS:".tableexport-ignore",emptyCSS:".tableexport-empty"},charset:"charset=utf-8",defaultFilename:"myDownload",defaultButton:"button-default",bootstrap:["btn","btn-default","btn-toolbar"],rowDel:"\r\n",entityMap:{"&":"&#38;","<":"&#60;",">":"&#62;","'":"&#39;","/":"&#47;"},xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:"\t",mimeType:"application/vnd.ms-excel",fileExtension:".xls"},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"text/csv",fileExtension:".csv"},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:"  ",mimeType:"text/plain",fileExtension:".txt"},escapeHtml:function(t){return String(t).replace(/[&<>'\/]/g,function(t){return p.prototype.entityMap[t]})},dateNum:function(t,e){e&&(t+=1462);var n=Date.parse(t);return(n-new Date(Date.UTC(1899,11,30)))/864e5},createSheet:function(t){for(var e={},n={s:{c:1e7,r:1e7},e:{c:0,r:0}},o=0;o!=t.length;++o)for(var s=0;s!=t[o].length;++s){n.s.r>o&&(n.s.r=o),n.s.c>s&&(n.s.c=s),n.e.r<o&&(n.e.r=o),n.e.c<s&&(n.e.c=s);var i={v:t[o][s]};if(null!=i.v){var a=r.utils.encode_cell({c:s,r:o});"number"==typeof i.v?i.t="n":"boolean"==typeof i.v?i.t="b":i.v instanceof Date?(i.t="n",i.z=r.SSF._table[14],i.v=this.dateNum(i.v)):i.t="s",e[a]=i}}return n.s.c<1e7&&(e["!ref"]=r.utils.encode_range(n)),e},Workbook:function(){this.SheetNames=[],this.Sheets={}},string2ArrayBuffer:function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),o=0;o!=t.length;++o)n[o]=255&t.charCodeAt(o);return e},export2file:function(t,e,s,i){if(r&&".xls"==i.substr(0,4)){var a=new this.Workbook,l=this.createSheet(t);a.SheetNames.push(s),a.Sheets[s]=l;var p={bookType:i.substr(1,3)+(i.substr(4)||"m"),bookSST:!1,type:"binary"},f=r.write(a,p);t=this.string2ArrayBuffer(f)}o(new n([t],{type:e+";"+this.charset}),s+i,!0)},update:function(t){return new p(this.selectors,s({},this.settings,t),(!0))},reset:function(){return new p(this.selectors,this.settings,(!0))},remove:function(){this.selectors.each(function(){var t=this.querySelectorAll("caption:not(.head)");t.parentNode.removeChild(t)})}},e){e.fn.tableExport=function(t,e){return new p(this,t,e)};for(var f in p.prototype)e.fn.tableExport[f]=p.prototype[f]}t["default"]=t.TableExport=p});
\ No newline at end of file
+!function(t,e){"function"==typeof define&&define.amd?define(["exports","jquery","blobjs","file-saverjs","xlsx-js"],e):"object"==typeof exports&&"string"!=typeof exports.nodeName?e(exports,require("jquery"),require("blobjs"),require("file-saverjs"),require("xlsx-js")):e(t,t.jQuery,t.Blob,t.saveAs,t.XLSX)}(this||window,function(t,e,n,r,o){"use strict";function s(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}function a(){for(var t=arguments,e=1;e<t.length;e++)for(var n in t[e])t[e].hasOwnProperty(n)&&(t[0][n]=t[e][n]);return t[0]}function i(t){return[].slice.call(t)}function l(t,e,n){for(var r=0;r<t.length;++r)t[r].addEventListener(e,n,!1)}function p(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.cls)}var u=function(t,e,n){var r=this;r.settings=n?e:a({},u.prototype.defaults,e),r.selectors=i(t);var f,c,y,m=u.prototype.rowDel,x=r.settings.ignoreRows instanceof Array?r.settings.ignoreRows:[r.settings.ignoreRows],d=r.settings.ignoreCols instanceof Array?r.settings.ignoreCols:[r.settings.ignoreCols],g=r.settings.ignoreCSS instanceof Array?r.settings.ignoreCSS.join(", "):r.settings.ignoreCSS,h=r.settings.emptyCSS instanceof Array?r.settings.emptyCSS.join(", "):r.settings.emptyCSS,b=u.prototype.formatValue.bind(this,r.settings.trimWhitespace),v=u.prototype.getType,C=new u.prototype.LocalStorage.getInstance;r.settings.bootstrap?(f=u.prototype.bootstrap[0]+" ",c=u.prototype.bootstrap[1]+" ",y=u.prototype.bootstrap[2]+" "):(f=u.prototype.defaultButton+" ",c=y=""),r.selectors.forEach(function(t){function e(e){var n=t.querySelectorAll("caption:not(.head)");n.length?n[0].appendChild(e):(n=document.createElement("caption"),n.className=y+r.settings.position,n.appendChild(e),t.insertBefore(n,t.firstChild))}function a(t,n,r){var o=document.createElement("button"),a=s();o.setAttribute("data-fileblob",a),C.setItem(a,t,!0),o.className=f+c+r,o.textContent=n,e(o)}var l=t.querySelectorAll("caption:not(.head)");n&&l.parentNode.removeChild(l);var S=i(t.querySelectorAll("tbody > tr")),S=r.settings.headings?i(t.querySelectorAll("thead > tr")).concat(S):S,S=r.settings.footers?i(t.querySelectorAll("tfoot > tr")).concat(S):S,A=r.settings.headings?t.querySelectorAll("thead > tr").length:0,w="id"===r.settings.filename?t.getAttribute("id")?t.getAttribute("id"):u.prototype.defaultFilename:r.settings.filename,E={xlsx:function(t,e){var n={},r=i(S).map(function(t,e){if(!~x.indexOf(e-A)&&!p(t,g)){var r=t.querySelectorAll("th, td");return i(r).map(function(t,r){if(!~d.indexOf(r)&&!p(t,g)){if(p(t,h))return" ";if(t.hasAttribute("colspan")&&(n[e]=n[e]||{},n[e][r+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var o=1;o<t.getAttribute("rowspan");o++)n[e+o]=n[e+o]||{},n[e+o][r]=1;if(n[e]){for(var s=r+1,a=0,i=0,o=0;o<=Math.max.apply(Math,Object.keys(n[e]))&&(n[e][o]?a=i>=r?a+n[e][o]:a:i++,i!==s);o++);return new Array(a).concat({v:b(t.textContent),t:v(t.className)})}return{v:b(t.textContent),t:v(t.className)}}})}}).map(function(t,e){return[].concat.apply([],t)}),o=u.prototype.escapeHtml(JSON.stringify({data:r,filename:e,mimeType:u.prototype.xlsx.mimeType,fileExtension:u.prototype.xlsx.fileExtension})),s=u.prototype.xlsx.buttonContent,l=u.prototype.xlsx.defaultClass;a(o,s,l)},xlsm:function(t,e){var n={},r=i(S).map(function(t,e){if(!~x.indexOf(e-A)&&!p(t,g)){var r=t.querySelectorAll("th, td");return i(r).map(function(t,r){if(!~d.indexOf(r)&&!p(t,g)){if(p(t,h))return" ";if(t.hasAttribute("colspan")&&(n[e]=n[e]||{},n[e][r+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var o=1;o<t.getAttribute("rowspan");o++)n[e+o]=n[e+o]||{},n[e+o][r]=1;if(n[e]){for(var s=r+1,a=0,i=0,o=0;o<=Math.max.apply(Math,Object.keys(n[e]))&&(n[e][o]?a=i>=r?a+n[e][o]:a:i++,i!==s);o++);return new Array(a).concat({v:b(t.textContent),t:v(t.className)})}return{v:b(t.textContent),t:v(t.className)}}})}}).map(function(t,e){return[].concat.apply([],t)}),o=u.prototype.escapeHtml(JSON.stringify({data:r,filename:e,mimeType:u.prototype.xls.mimeType,fileExtension:u.prototype.xls.fileExtension})),s=u.prototype.xls.buttonContent,l=u.prototype.xls.defaultClass;a(o,s,l)},xls:function(t,e){var n=u.prototype.xls.separator,r=i(S).map(function(t,e){if(!~x.indexOf(e-A)&&!p(t,g)){var r=t.querySelectorAll("th, td");return i(r).map(function(t,e){if(!~d.indexOf(e)&&!p(t,g))return p(t,h)?" ":{v:b(t.textContent),t:v(t.className)}}).join(n)}}).join(t).map(function(t,e){return[].concat.apply([],t)}),o=u.prototype.escapeHtml(JSON.stringify({data:r,filename:e,mimeType:u.prototype.xls.mimeType,fileExtension:u.prototype.xls.fileExtension})),s=u.prototype.xls.buttonContent,l=u.prototype.xls.defaultClass;a(o,s,l)},csv:function(t,e){var n=u.prototype.csv.separator,r=i(S).map(function(t,e){if(!~x.indexOf(e-A)&&!p(t,g)){var r=t.querySelectorAll("th, td");return i(r).map(function(t,e){if(!~d.indexOf(e)&&!p(t,g))return p(t,h)?" ":'"'+b(t.textContent.replace(/"/g,'""'))+'"'}).join(n)}}).join(t),o=u.prototype.escapeHtml(JSON.stringify({data:r,filename:e,mimeType:u.prototype.csv.mimeType,fileExtension:u.prototype.csv.fileExtension})),s=u.prototype.csv.buttonContent,l=u.prototype.csv.defaultClass;a(o,s,l)},txt:function(t,e){var n=u.prototype.txt.separator,r=i(S).map(function(t,e){if(!~x.indexOf(e-A)&&!p(t,g)){var r=t.querySelectorAll("th, td");return i(r).map(function(t,e){if(!~d.indexOf(e)&&!p(t,g))return p(t,h)?" ":b(t.textContent)}).join(n)}}).join(t),o=u.prototype.escapeHtml(JSON.stringify({data:r,filename:e,mimeType:u.prototype.txt.mimeType,fileExtension:u.prototype.txt.fileExtension})),s=u.prototype.txt.buttonContent,l=u.prototype.txt.defaultClass;a(o,s,l)}};r.settings.formats.forEach(function(t){!(!o||"xls"!==t)&&(t="xlsm"),!o&&"xlsx"===t&&(t=null),t&&E[t](m,w)})});var S=document.querySelectorAll("button[data-fileblob]");return l(S,"click",function(){var t=JSON.parse(C.getItem(this.getAttribute("data-fileblob"))),e=t.data,n=t.filename,r=t.mimeType,o=t.fileExtension;u.prototype.export2file(e,r,n,o)}),r};u.prototype={version:"4.0.0-alpha.5",defaults:{headings:!0,footers:!0,formats:["xls","csv","txt"],filename:"id",bootstrap:!0,position:"bottom",ignoreRows:null,ignoreCols:null,ignoreCSS:".tableexport-ignore",emptyCSS:".tableexport-empty",trimWhitespace:!1},charset:"charset=utf-8",defaultFilename:"myDownload",defaultButton:"button-default",bootstrap:["btn","btn-default","btn-toolbar"],rowDel:"\r\n",entityMap:{"&":"&#38;","<":"&#60;",">":"&#62;","'":"&#39;","/":"&#47;"},xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:"\t",mimeType:"application/vnd.ms-excel",fileExtension:".xls"},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"text/csv",fileExtension:".csv"},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:"  ",mimeType:"text/plain",fileExtension:".txt"},types:{string:{defaultClass:"tableexport-string"},number:{defaultClass:"tableexport-number",assert:function(t){return!isNaN(t.replace(/,/g,""))}},"boolean":{defaultClass:"tableexport-boolean",assert:function(t){return"true"===t.toLowerCase()||"false"===t.toLowerCase()}},date:{defaultClass:"tableexport-date",assert:function(t){return!isNaN(Date.parse(t))}}},escapeHtml:function(t){return String(t).replace(/[&<>'\/]/g,function(t){return u.prototype.entityMap[t]})},formatValue:function(t,e){return t?e.trim():e},getType:function(t){if(!t)return"";var e=u.prototype.types;return~t.indexOf(e.string.defaultClass)?"s":~t.indexOf(e.number.defaultClass)?"n":~t.indexOf(e["boolean"].defaultClass)?"b":~t.indexOf(e.date.defaultClass)?"d":""},dateNum:function(t,e){e&&(t+=1462);var n=Date.parse(t);return(n-new Date(Date.UTC(1899,11,30)))/864e5},createSheet:function(t){for(var e={},n={s:{c:1e7,r:1e7},e:{c:0,r:0}},r=u.prototype.types,s=0;s!==t.length;++s)for(var a=0;a!==t[s].length;++a){n.s.r>s&&(n.s.r=s),n.s.c>a&&(n.s.c=a),n.e.r<s&&(n.e.r=s),n.e.c<a&&(n.e.c=a);var i=t[s][a];if(i&&i.v){var l=o.utils.encode_cell({c:a,r:s});i.t||(r.number.assert(i.v)?i.t="n":r["boolean"].assert(i.v)?i.t="b":r.date.assert(i.v)?i.t="d":i.t="s"),"d"===i.t&&(i.t="n",i.z=o.SSF._table[14],i.v=this.dateNum(i.v)),e[l]=i}}return n.s.c<1e7&&(e["!ref"]=o.utils.encode_range(n)),e},Workbook:function(){this.SheetNames=[],this.Sheets={}},string2ArrayBuffer:function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),r=0;r!==t.length;++r)n[r]=255&t.charCodeAt(r);return e},export2file:function(t,e,s,a){if(o&&".xls"===a.substr(0,4)){var i=new this.Workbook,l=this.createSheet(t);i.SheetNames.push(s),i.Sheets[s]=l;var p={bookType:a.substr(1,3)+(a.substr(4)||"m"),bookSST:!1,type:"binary"},u=o.write(i,p);t=this.string2ArrayBuffer(u)}r(new n([t],{type:e+";"+this.charset}),s+a,!0)},LocalStorage:function(){this.type="localStorage",this.store=t[this.type],this.namespace="te",this.getKey=function(t){return this.namespace+t},this.setItem=function(t,e,n){var r=this.getKey(t);if(!this.exists(r)||n)return this.store.setItem(r,e)},this.getItem=function(t){var e=this.getKey(t);return this.store.getItem(e)},this.exists=function(t){var e=this.getKey(t);return null!==this.store.getItem(e)},this.removeItem=function(t){var e=this.getKey(t);return this.store.removeItem(e)},this.error=function(t){return new Error("unknown error occurred",t)}}};var f=u.prototype.LocalStorage;if(f._instance=null,f.getInstance=function(){return f._instance||(f._instance=new f),f._instance},e){e.fn.tableExport=function(t,e){return new u(this,t,e)};for(var c in u.prototype)e.fn.tableExport[c]=u.prototype[c]}return t["default"]=t.TableExport=u});
\ No newline at end of file
diff --git a/dist/typings/tableexport.d.ts b/dist/typings/tableexport.d.ts
index fabb472..2dad856 100644
--- a/dist/typings/tableexport.d.ts
+++ b/dist/typings/tableexport.d.ts
@@ -88,6 +88,12 @@ export class TableExport {
      */
     txt: TXT;
 
+    /**
+     * Cell-types override and assertion configuration
+     * @memberof TableExport.prototype
+     */
+    types: Types;
+
     /**
      * Escapes special characters with HTML entities
      * @memberof TableExport.prototype
@@ -96,6 +102,23 @@ export class TableExport {
      */
     escapeHtml: (string: string) => string;
 
+    /**
+     * Removes leading/trailing whitespace from cell string
+     * @memberof TableExport.prototype
+     * @param isTrimWhitespace {Boolean}
+     * @param string {String}
+     * @returns {String} trimmed string
+     */
+    formatValue: (string: string) => string;
+
+    /**
+     * Get cell data-type
+     * @memberof TableExport.prototype
+     * @param string {String}
+     * @returns {String} data-type
+     */
+    getType: (string: string) => string;
+
     /**
      * Formats datetimes for compatibility with Excel
      * @memberof TableExport.prototype
@@ -111,7 +134,7 @@ export class TableExport {
      * @param data {String}
      * @returns {Number} epoch time
      */
-    createSheet: (data: string) => number;
+    createSheet: (data: string) => void;
 
     /**
      * Converts a string to an arraybuffer
@@ -174,6 +197,7 @@ export interface Defaults {
     ignoreCols: number[];
     ignoreCSS: string;
     emptyCSS: string;
+    trimWhitespace: boolean;
 }
 
 /**
@@ -224,6 +248,22 @@ export interface TXT {
     fileExtension: string;
 }
 
+/**
+ * Cell-types override and assertion configuration
+ * @memberof TableExport.prototype
+ */
+export interface Types {
+    string: Type;
+    number: Type;
+    boolean: Type;
+    date: Type;
+}
+
+export interface Type {
+    defaultClass: string;
+    assert: (v: any) => boolean;
+}
+
 interface JQuery {
 
     /**
diff --git a/package.json b/package.json
index c923e7b..8f64df6 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "tableexport",
-  "version": "4.0.0-alpha.4",
+  "version": "4.0.0-alpha.5",
   "authors": [
     "clarketm <travis.m.clarke@gmail.com>"
   ],
diff --git a/src/stable/css/tableexport.css b/src/stable/css/tableexport.css
index 29b0114..233a601 100644
--- a/src/stable/css/tableexport.css
+++ b/src/stable/css/tableexport.css
@@ -1,5 +1,5 @@
 /*!
- * TableExport.js 4.0.0-alpha.4 (https://www.travismclarke.com)
+ * TableExport.js 4.0.0-alpha.5 (https://www.travismclarke.com)
  * Copyright 2017 Travis Clarke
  * Licensed under the MIT license
  */
diff --git a/src/stable/css/tableexport.min.css b/src/stable/css/tableexport.min.css
index 0fd03a4..96ae58a 100644
--- a/src/stable/css/tableexport.min.css
+++ b/src/stable/css/tableexport.min.css
@@ -1,5 +1,5 @@
 /*!
- * TableExport.js 4.0.0-alpha.4 (https://www.travismclarke.com)
+ * TableExport.js 4.0.0-alpha.5 (https://www.travismclarke.com)
  * Copyright 2017 Travis Clarke
  * Licensed under the MIT license
  */.top{caption-side:top}.bottom{caption-side:bottom}.button-default,.button-default:active,.button-default:focus,.button-default:hover{text-decoration:none}.button-default{font:700 12px sans-serif;color:#222;cursor:pointer;padding:5px;margin:5px}.button-default.csv:before,.button-default.txt:before,.button-default.xls:before,.button-default.xlsx:before{content:none}.csv,.txt,.xls,.xlsx{margin:4px 0}.csv:before,.txt:before,.xls:before,.xlsx:before{margin-right:10px;padding:11px 15px 12px;box-shadow:1px 1px 2px rgba(0,0,0,.2)}.xlsx:before{content:"";background:#006400 url(../img/xlsx.svg) no-repeat center}.xls:before{content:"";background:green url(../img/xls.svg) no-repeat center}.csv:before{content:"";background:#00f url(../img/csv.svg) no-repeat center}.txt:before{content:"";background:purple url(../img/txt.svg) no-repeat center}
\ No newline at end of file
diff --git a/src/stable/js/tableexport.js b/src/stable/js/tableexport.js
index 3214c9a..d6fd128 100644
--- a/src/stable/js/tableexport.js
+++ b/src/stable/js/tableexport.js
@@ -1,5 +1,5 @@
 /*!
- * TableExport.js 4.0.0-alpha.4 (https://www.travismclarke.com)
+ * TableExport.js 4.0.0-alpha.5 (https://www.travismclarke.com)
  * Copyright 2017 Travis Clarke
  * Licensed under the MIT license
  */
@@ -15,7 +15,7 @@
         // Browser globals
         factory(root, root.jQuery, root.Blob, root.saveAs, root.XLSX);
     }
-}(this, function (exports, $, Blob, saveAs, XLSX) {
+}(this || window, function (exports, $, Blob, saveAs, XLSX) {
         'use strict';
         /**
          * TableExport main plugin constructor
@@ -43,6 +43,7 @@
                 emptyCSS = self.settings.emptyCSS instanceof Array ? self.settings.emptyCSS.join(", ") : self.settings.emptyCSS,
                 formatValue = TableExport.prototype.formatValue.bind(this, self.settings.trimWhitespace),
                 getType = TableExport.prototype.getType,
+                store = new TableExport.prototype.LocalStorage.getInstance(),
                 bootstrapClass, bootstrapTheme, bootstrapSpacing;
 
             if (self.settings.bootstrap) {
@@ -109,6 +110,8 @@
                                             t: getType(val.className)
                                         };
                                     });
+                                }).map(function (val, ir) {
+                                    return [].concat.apply([], val);
                                 }),
                                 dataObject = TableExport.prototype.escapeHtml(
                                     JSON.stringify({
@@ -166,6 +169,8 @@
                                             t: getType(val.className)
                                         };
                                     });
+                                }).map(function (val, ir) {
+                                    return [].concat.apply([], val);
                                 }),
                                 dataObject = TableExport.prototype.escapeHtml(
                                     JSON.stringify({
@@ -197,7 +202,9 @@
                                             t: getType(val.className)
                                         };
                                     }).join(colD);
-                                }).join(rdel),
+                                }).join(rdel).map(function (val, ir) {
+                                    return [].concat.apply([], val);
+                                }),
                                 dataObject = TableExport.prototype.escapeHtml(
                                     JSON.stringify({
                                         data: dataURL,
@@ -299,7 +306,9 @@
                  */
                 function createObjButton(dataObject, myContent, myClass) {
                     var exportButton = document.createElement('button');
-                    exportButton.setAttribute('data-fileblob', dataObject);
+                    var uuid = _uuid();
+                    exportButton.setAttribute('data-fileblob', uuid);
+                    store.setItem(uuid, dataObject, true);
                     exportButton.className = bootstrapClass + bootstrapTheme + myClass;
                     exportButton.textContent = myContent;
                     checkCaption(exportButton);
@@ -308,7 +317,7 @@
 
             var exportButton = document.querySelectorAll("button[data-fileblob]");
             _on(exportButton, "click", function () {
-                var object = JSON.parse(this.getAttribute("data-fileblob")),
+                var object = JSON.parse(store.getItem(this.getAttribute("data-fileblob"))),
                     data = object.data,
                     filename = object.filename,
                     mimeType = object.mimeType,
@@ -324,7 +333,7 @@
              * Version.
              * @memberof TableExport.prototype
              */
-            version: "4.0.0-alpha.4",
+            version: "4.0.0-alpha.5",
             /**
              * Default plugin options.
              * @memberof TableExport.prototype
@@ -498,7 +507,6 @@
              * Creates an Excel spreadsheet from a data string
              * @memberof TableExport.prototype
              * @param data {String}
-             * @returns {Number} epoch time
              */
             createSheet: function (data) {
                 var ws = {};
@@ -563,7 +571,7 @@
              * @param extension {String} file extension
              */
             export2file: function (data, mime, name, extension) {
-                if (XLSX && extension.substr(0, 4) === ".xls") {
+                if (XLSX && extension.substr(0, 4) === (".xls")) {
                     var wb = new this.Workbook(),
                         ws = this.createSheet(data);
 
@@ -583,31 +591,62 @@
                     name + extension, true);
             },
             /**
-             * Updates the plugin instance with new/updated options
-             * @param options {Object} TableExport configuration options
-             * @returns {TableExport} updated TableExport instance
-             */
-            update: function (options) {
-                return new TableExport(this.selectors, _extend({}, this.settings, options), true);
-            },
-            /**
-             * Reset the plugin instance to its original state
-             * @returns {TableExport} original TableExport instance
-             */
-            reset: function () {
-                return new TableExport(this.selectors, this.settings, true);
-            },
-            /**
-             * Remove the instance (i.e. caption containing the export buttons)
+             * LocalStorage main interface constructor
+             * @memberof TableExport.prototype
+             * @constructor
              */
-            remove: function () {
-                this.selectors.each(function () {
-                    var caption = this.querySelectorAll('caption:not(.head)');
-                    caption.parentNode.removeChild(caption);
-                });
+            LocalStorage: function () {
+                this.type = 'localStorage';
+                this.store = exports[this.type];
+                this.namespace = 'te';
+                this.getKey = function (key) {
+                    return this.namespace + key;
+                };
+                this.setItem = function (_key, value, overwrite) {
+                    var key = this.getKey(_key);
+                    if (this.exists(key) && !overwrite) {
+                        return;
+                    }
+                    return this.store.setItem(key, value);
+                };
+                this.getItem = function (_key) {
+                    var key = this.getKey(_key);
+                    return this.store.getItem(key);
+                };
+                this.exists = function (_key) {
+                    var key = this.getKey(_key);
+                    return this.store.getItem(key) !== null;
+                };
+                this.removeItem = function (_key) {
+                    var key = this.getKey(_key);
+                    return this.store.removeItem(key);
+                };
+                this.error = function (message) {
+                    return new Error('unknown error occurred', message);
+                };
+            }
+        };
+
+        var _store = TableExport.prototype.LocalStorage;
+        _store._instance = null;
+        _store.getInstance = function () {
+            if (!_store._instance) {
+                _store._instance = new _store();
             }
+            return _store._instance;
         };
 
+        function _uuid() {
+            function s4() {
+                return Math.floor((1 + Math.random()) * 0x10000)
+                    .toString(16)
+                    .substring(1);
+            }
+
+            return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+                s4() + '-' + s4() + s4() + s4();
+        }
+
         function _extend() {
             var args = arguments;
             for (var i = 1; i < args.length; i++)
@@ -648,7 +687,7 @@
             }
         }
 
-        exports.default = exports.TableExport = TableExport;
+        return exports.default = exports.TableExport = TableExport;
 
     }
 ));
diff --git a/src/stable/js/tableexport.min.js b/src/stable/js/tableexport.min.js
index 7043dfc..75109ec 100644
--- a/src/stable/js/tableexport.min.js
+++ b/src/stable/js/tableexport.min.js
@@ -1,6 +1,6 @@
 /*!
- * TableExport.js 4.0.0-alpha.4 (https://www.travismclarke.com)
+ * TableExport.js 4.0.0-alpha.5 (https://www.travismclarke.com)
  * Copyright 2017 Travis Clarke
  * Licensed under the MIT license
  */
-!function(t,e){"function"==typeof define&&define.amd?define(["exports","jquery","blobjs","file-saverjs","xlsx-js"],e):"object"==typeof exports&&"string"!=typeof exports.nodeName?e(exports,require("jquery"),require("blobjs"),require("file-saverjs"),require("xlsx-js")):e(t,t.jQuery,t.Blob,t.saveAs,t.XLSX)}(this,function(t,e,n,o,r){"use strict";function s(){for(var t=arguments,e=1;e<t.length;e++)for(var n in t[e])t[e].hasOwnProperty(n)&&(t[0][n]=t[e][n]);return t[0]}function i(t){return[].slice.call(t)}function a(t,e,n){for(var o=0;o<t.length;++o)t[o].addEventListener(e,n,!1)}function l(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.cls)}var p=function(t,n,o){var f=this;f.settings=o?n:s({},p.prototype.defaults,n),f.selectors=i(t);var u,c,x,y=p.prototype.rowDel,m=f.settings.ignoreRows instanceof Array?f.settings.ignoreRows:[f.settings.ignoreRows],d=f.settings.ignoreCols instanceof Array?f.settings.ignoreCols:[f.settings.ignoreCols],h=f.settings.ignoreCSS instanceof Array?f.settings.ignoreCSS.join(", "):f.settings.ignoreCSS,g=f.settings.emptyCSS instanceof Array?f.settings.emptyCSS.join(", "):f.settings.emptyCSS;f.settings.bootstrap?(u=p.prototype.bootstrap[0]+" ",c=p.prototype.bootstrap[1]+" ",x=p.prototype.bootstrap[2]+" "):(u=p.prototype.defaultButton+" ",c=x=""),f.selectors.forEach(function(t){function n(e){var n=t.querySelectorAll("caption:not(.head)");n.length?n[0].appendChild(e):(n=document.createElement("caption"),n.className=x+f.settings.position,n.appendChild(e),t.insertBefore(n,t.firstChild))}function s(t,e,o){var r=document.createElement("button");r.setAttribute("data-fileblob",t),r.className=u+c+o,r.textContent=e,n(r)}var a=t.querySelectorAll("caption:not(.head)");o&&a.parentNode.removeChild(a);var b=i(t.querySelectorAll("tbody > tr")),b=f.settings.headings?i(t.querySelectorAll("thead > tr")).concat(b):b,b=f.settings.footers?i(t.querySelectorAll("tfoot > tr")).concat(b):b,v=f.settings.headings?t.querySelectorAll("thead > tr").length:0,S="id"===f.settings.filename?t.getAttribute("id")?t.getAttribute("id"):p.prototype.defaultFilename:f.settings.filename,C={xlsx:function(t,n){var o={},r=i(b).map(function(t,n){if(!~m.indexOf(n-v)&&!l(t,h)){var r=t.querySelectorAll("th, td");return i(r).map(function(t,r){if(!~d.indexOf(r)&&!l(t,h)){if(l(t,g))return" ";if(t.hasAttribute("colspan")&&(o[n]=o[n]||{},o[n][r+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var s=1;s<t.getAttribute("rowspan");s++)o[n+s]=o[n+s]||{},o[n+s][r]=1;if(o[n]){for(var i=r+1,a=0,p=0,s=0;s<=Math.max.apply(Math,Object.keys(o[n]))&&(o[n][s]?a=p>=r?a+o[n][s]:a:p++,p!==i);s++);return new Array(a).concat(e(t).text())}return t.textContent}})}}),a=p.prototype.escapeHtml(JSON.stringify({data:r,filename:n,mimeType:p.prototype.xlsx.mimeType,fileExtension:p.prototype.xlsx.fileExtension})),f=p.prototype.xlsx.buttonContent,u=p.prototype.xlsx.defaultClass;s(a,f,u)},xlsm:function(t,n){var o={},r=i(b).map(function(t,n){if(!~m.indexOf(n-v)&&!l(t,h)){var r=t.querySelectorAll("th, td");return i(r).map(function(t,r){if(!~d.indexOf(r)&&!l(t,h)){if(l(t,g))return" ";if(t.hasAttribute("colspan")&&(o[n]=o[n]||{},o[n][r+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var s=1;s<t.getAttribute("rowspan");s++)o[n+s]=o[n+s]||{},o[n+s][r]=1;if(o[n]){for(var i=r+1,a=0,p=0,s=0;s<=Math.max.apply(Math,Object.keys(o[n]))&&(o[n][s]?a=p>=r?a+o[n][s]:a:p++,p!==i);s++);return new Array(a).concat(e(t).text())}return t.textContent}})}}),a=p.prototype.escapeHtml(JSON.stringify({data:r,filename:n,mimeType:p.prototype.xls.mimeType,fileExtension:p.prototype.xls.fileExtension})),f=p.prototype.xls.buttonContent,u=p.prototype.xls.defaultClass;s(a,f,u)},xls:function(t,e){var n=p.prototype.xls.separator,o=i(b).map(function(t,e){if(!~m.indexOf(e-v)&&!l(t,h)){var o=t.querySelectorAll("th, td");return i(o).map(function(t,e){if(!~d.indexOf(e)&&!l(t,h))return l(t,g)?" ":t.textContent}).join(n)}}).join(t),r=p.prototype.escapeHtml(JSON.stringify({data:o,filename:e,mimeType:p.prototype.xls.mimeType,fileExtension:p.prototype.xls.fileExtension})),a=p.prototype.xls.buttonContent,f=p.prototype.xls.defaultClass;s(r,a,f)},csv:function(t,e){var n=p.prototype.csv.separator,o=i(b).map(function(t,e){if(!~m.indexOf(e-v)&&!l(t,h)){var o=t.querySelectorAll("th, td");return i(o).map(function(t,e){if(!~d.indexOf(e)&&!l(t,h))return l(t,g)?" ":'"'+t.textContent.replace(/"/g,'""')+'"'}).join(n)}}).join(t),r=p.prototype.escapeHtml(JSON.stringify({data:o,filename:e,mimeType:p.prototype.csv.mimeType,fileExtension:p.prototype.csv.fileExtension})),a=p.prototype.csv.buttonContent,f=p.prototype.csv.defaultClass;s(r,a,f)},txt:function(t,e){var n=p.prototype.txt.separator,o=i(b).map(function(t,e){if(!~m.indexOf(e-v)&&!l(t,h)){var o=t.querySelectorAll("th, td");return i(o).map(function(t,e){if(!~d.indexOf(e)&&!l(t,h))return l(t,g)?" ":t.textContent}).join(n)}}).join(t),r=p.prototype.escapeHtml(JSON.stringify({data:o,filename:e,mimeType:p.prototype.txt.mimeType,fileExtension:p.prototype.txt.fileExtension})),a=p.prototype.txt.buttonContent,f=p.prototype.txt.defaultClass;s(r,a,f)}};f.settings.formats.forEach(function(t){!(!r||"xls"!==t)&&(t="xlsm"),!r&&"xlsx"===t&&(t=null),t&&C[t](y,S)})});var b=document.querySelectorAll("button[data-fileblob]");return a(b,"click",function(){var t=JSON.parse(this.getAttribute("data-fileblob")),e=t.data,n=t.filename,o=t.mimeType,r=t.fileExtension;p.prototype.export2file(e,o,n,r)}),f};if(p.prototype={version:"4.0.0-alpha.4",defaults:{headings:!0,footers:!0,formats:["xls","csv","txt"],filename:"id",bootstrap:!0,position:"bottom",ignoreRows:null,ignoreCols:null,ignoreCSS:".tableexport-ignore",emptyCSS:".tableexport-empty"},charset:"charset=utf-8",defaultFilename:"myDownload",defaultButton:"button-default",bootstrap:["btn","btn-default","btn-toolbar"],rowDel:"\r\n",entityMap:{"&":"&#38;","<":"&#60;",">":"&#62;","'":"&#39;","/":"&#47;"},xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:"\t",mimeType:"application/vnd.ms-excel",fileExtension:".xls"},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"text/csv",fileExtension:".csv"},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:"  ",mimeType:"text/plain",fileExtension:".txt"},escapeHtml:function(t){return String(t).replace(/[&<>'\/]/g,function(t){return p.prototype.entityMap[t]})},dateNum:function(t,e){e&&(t+=1462);var n=Date.parse(t);return(n-new Date(Date.UTC(1899,11,30)))/864e5},createSheet:function(t){for(var e={},n={s:{c:1e7,r:1e7},e:{c:0,r:0}},o=0;o!=t.length;++o)for(var s=0;s!=t[o].length;++s){n.s.r>o&&(n.s.r=o),n.s.c>s&&(n.s.c=s),n.e.r<o&&(n.e.r=o),n.e.c<s&&(n.e.c=s);var i={v:t[o][s]};if(null!=i.v){var a=r.utils.encode_cell({c:s,r:o});"number"==typeof i.v?i.t="n":"boolean"==typeof i.v?i.t="b":i.v instanceof Date?(i.t="n",i.z=r.SSF._table[14],i.v=this.dateNum(i.v)):i.t="s",e[a]=i}}return n.s.c<1e7&&(e["!ref"]=r.utils.encode_range(n)),e},Workbook:function(){this.SheetNames=[],this.Sheets={}},string2ArrayBuffer:function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),o=0;o!=t.length;++o)n[o]=255&t.charCodeAt(o);return e},export2file:function(t,e,s,i){if(r&&".xls"==i.substr(0,4)){var a=new this.Workbook,l=this.createSheet(t);a.SheetNames.push(s),a.Sheets[s]=l;var p={bookType:i.substr(1,3)+(i.substr(4)||"m"),bookSST:!1,type:"binary"},f=r.write(a,p);t=this.string2ArrayBuffer(f)}o(new n([t],{type:e+";"+this.charset}),s+i,!0)},update:function(t){return new p(this.selectors,s({},this.settings,t),(!0))},reset:function(){return new p(this.selectors,this.settings,(!0))},remove:function(){this.selectors.each(function(){var t=this.querySelectorAll("caption:not(.head)");t.parentNode.removeChild(t)})}},e){e.fn.tableExport=function(t,e){return new p(this,t,e)};for(var f in p.prototype)e.fn.tableExport[f]=p.prototype[f]}t["default"]=t.TableExport=p});
\ No newline at end of file
+!function(t,e){"function"==typeof define&&define.amd?define(["exports","jquery","blobjs","file-saverjs","xlsx-js"],e):"object"==typeof exports&&"string"!=typeof exports.nodeName?e(exports,require("jquery"),require("blobjs"),require("file-saverjs"),require("xlsx-js")):e(t,t.jQuery,t.Blob,t.saveAs,t.XLSX)}(this||window,function(t,e,n,r,o){"use strict";function s(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}function a(){for(var t=arguments,e=1;e<t.length;e++)for(var n in t[e])t[e].hasOwnProperty(n)&&(t[0][n]=t[e][n]);return t[0]}function i(t){return[].slice.call(t)}function l(t,e,n){for(var r=0;r<t.length;++r)t[r].addEventListener(e,n,!1)}function p(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.cls)}var u=function(t,e,n){var r=this;r.settings=n?e:a({},u.prototype.defaults,e),r.selectors=i(t);var f,c,y,m=u.prototype.rowDel,x=r.settings.ignoreRows instanceof Array?r.settings.ignoreRows:[r.settings.ignoreRows],d=r.settings.ignoreCols instanceof Array?r.settings.ignoreCols:[r.settings.ignoreCols],g=r.settings.ignoreCSS instanceof Array?r.settings.ignoreCSS.join(", "):r.settings.ignoreCSS,h=r.settings.emptyCSS instanceof Array?r.settings.emptyCSS.join(", "):r.settings.emptyCSS,b=u.prototype.formatValue.bind(this,r.settings.trimWhitespace),v=u.prototype.getType,C=new u.prototype.LocalStorage.getInstance;r.settings.bootstrap?(f=u.prototype.bootstrap[0]+" ",c=u.prototype.bootstrap[1]+" ",y=u.prototype.bootstrap[2]+" "):(f=u.prototype.defaultButton+" ",c=y=""),r.selectors.forEach(function(t){function e(e){var n=t.querySelectorAll("caption:not(.head)");n.length?n[0].appendChild(e):(n=document.createElement("caption"),n.className=y+r.settings.position,n.appendChild(e),t.insertBefore(n,t.firstChild))}function a(t,n,r){var o=document.createElement("button"),a=s();o.setAttribute("data-fileblob",a),C.setItem(a,t,!0),o.className=f+c+r,o.textContent=n,e(o)}var l=t.querySelectorAll("caption:not(.head)");n&&l.parentNode.removeChild(l);var S=i(t.querySelectorAll("tbody > tr")),S=r.settings.headings?i(t.querySelectorAll("thead > tr")).concat(S):S,S=r.settings.footers?i(t.querySelectorAll("tfoot > tr")).concat(S):S,A=r.settings.headings?t.querySelectorAll("thead > tr").length:0,w="id"===r.settings.filename?t.getAttribute("id")?t.getAttribute("id"):u.prototype.defaultFilename:r.settings.filename,E={xlsx:function(t,e){var n={},r=i(S).map(function(t,e){if(!~x.indexOf(e-A)&&!p(t,g)){var r=t.querySelectorAll("th, td");return i(r).map(function(t,r){if(!~d.indexOf(r)&&!p(t,g)){if(p(t,h))return" ";if(t.hasAttribute("colspan")&&(n[e]=n[e]||{},n[e][r+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var o=1;o<t.getAttribute("rowspan");o++)n[e+o]=n[e+o]||{},n[e+o][r]=1;if(n[e]){for(var s=r+1,a=0,i=0,o=0;o<=Math.max.apply(Math,Object.keys(n[e]))&&(n[e][o]?a=i>=r?a+n[e][o]:a:i++,i!==s);o++);return new Array(a).concat({v:b(t.textContent),t:v(t.className)})}return{v:b(t.textContent),t:v(t.className)}}})}}).map(function(t,e){return[].concat.apply([],t)}),o=u.prototype.escapeHtml(JSON.stringify({data:r,filename:e,mimeType:u.prototype.xlsx.mimeType,fileExtension:u.prototype.xlsx.fileExtension})),s=u.prototype.xlsx.buttonContent,l=u.prototype.xlsx.defaultClass;a(o,s,l)},xlsm:function(t,e){var n={},r=i(S).map(function(t,e){if(!~x.indexOf(e-A)&&!p(t,g)){var r=t.querySelectorAll("th, td");return i(r).map(function(t,r){if(!~d.indexOf(r)&&!p(t,g)){if(p(t,h))return" ";if(t.hasAttribute("colspan")&&(n[e]=n[e]||{},n[e][r+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var o=1;o<t.getAttribute("rowspan");o++)n[e+o]=n[e+o]||{},n[e+o][r]=1;if(n[e]){for(var s=r+1,a=0,i=0,o=0;o<=Math.max.apply(Math,Object.keys(n[e]))&&(n[e][o]?a=i>=r?a+n[e][o]:a:i++,i!==s);o++);return new Array(a).concat({v:b(t.textContent),t:v(t.className)})}return{v:b(t.textContent),t:v(t.className)}}})}}).map(function(t,e){return[].concat.apply([],t)}),o=u.prototype.escapeHtml(JSON.stringify({data:r,filename:e,mimeType:u.prototype.xls.mimeType,fileExtension:u.prototype.xls.fileExtension})),s=u.prototype.xls.buttonContent,l=u.prototype.xls.defaultClass;a(o,s,l)},xls:function(t,e){var n=u.prototype.xls.separator,r=i(S).map(function(t,e){if(!~x.indexOf(e-A)&&!p(t,g)){var r=t.querySelectorAll("th, td");return i(r).map(function(t,e){if(!~d.indexOf(e)&&!p(t,g))return p(t,h)?" ":{v:b(t.textContent),t:v(t.className)}}).join(n)}}).join(t).map(function(t,e){return[].concat.apply([],t)}),o=u.prototype.escapeHtml(JSON.stringify({data:r,filename:e,mimeType:u.prototype.xls.mimeType,fileExtension:u.prototype.xls.fileExtension})),s=u.prototype.xls.buttonContent,l=u.prototype.xls.defaultClass;a(o,s,l)},csv:function(t,e){var n=u.prototype.csv.separator,r=i(S).map(function(t,e){if(!~x.indexOf(e-A)&&!p(t,g)){var r=t.querySelectorAll("th, td");return i(r).map(function(t,e){if(!~d.indexOf(e)&&!p(t,g))return p(t,h)?" ":'"'+b(t.textContent.replace(/"/g,'""'))+'"'}).join(n)}}).join(t),o=u.prototype.escapeHtml(JSON.stringify({data:r,filename:e,mimeType:u.prototype.csv.mimeType,fileExtension:u.prototype.csv.fileExtension})),s=u.prototype.csv.buttonContent,l=u.prototype.csv.defaultClass;a(o,s,l)},txt:function(t,e){var n=u.prototype.txt.separator,r=i(S).map(function(t,e){if(!~x.indexOf(e-A)&&!p(t,g)){var r=t.querySelectorAll("th, td");return i(r).map(function(t,e){if(!~d.indexOf(e)&&!p(t,g))return p(t,h)?" ":b(t.textContent)}).join(n)}}).join(t),o=u.prototype.escapeHtml(JSON.stringify({data:r,filename:e,mimeType:u.prototype.txt.mimeType,fileExtension:u.prototype.txt.fileExtension})),s=u.prototype.txt.buttonContent,l=u.prototype.txt.defaultClass;a(o,s,l)}};r.settings.formats.forEach(function(t){!(!o||"xls"!==t)&&(t="xlsm"),!o&&"xlsx"===t&&(t=null),t&&E[t](m,w)})});var S=document.querySelectorAll("button[data-fileblob]");return l(S,"click",function(){var t=JSON.parse(C.getItem(this.getAttribute("data-fileblob"))),e=t.data,n=t.filename,r=t.mimeType,o=t.fileExtension;u.prototype.export2file(e,r,n,o)}),r};u.prototype={version:"4.0.0-alpha.5",defaults:{headings:!0,footers:!0,formats:["xls","csv","txt"],filename:"id",bootstrap:!0,position:"bottom",ignoreRows:null,ignoreCols:null,ignoreCSS:".tableexport-ignore",emptyCSS:".tableexport-empty",trimWhitespace:!1},charset:"charset=utf-8",defaultFilename:"myDownload",defaultButton:"button-default",bootstrap:["btn","btn-default","btn-toolbar"],rowDel:"\r\n",entityMap:{"&":"&#38;","<":"&#60;",">":"&#62;","'":"&#39;","/":"&#47;"},xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:"\t",mimeType:"application/vnd.ms-excel",fileExtension:".xls"},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"text/csv",fileExtension:".csv"},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:"  ",mimeType:"text/plain",fileExtension:".txt"},types:{string:{defaultClass:"tableexport-string"},number:{defaultClass:"tableexport-number",assert:function(t){return!isNaN(t.replace(/,/g,""))}},"boolean":{defaultClass:"tableexport-boolean",assert:function(t){return"true"===t.toLowerCase()||"false"===t.toLowerCase()}},date:{defaultClass:"tableexport-date",assert:function(t){return!isNaN(Date.parse(t))}}},escapeHtml:function(t){return String(t).replace(/[&<>'\/]/g,function(t){return u.prototype.entityMap[t]})},formatValue:function(t,e){return t?e.trim():e},getType:function(t){if(!t)return"";var e=u.prototype.types;return~t.indexOf(e.string.defaultClass)?"s":~t.indexOf(e.number.defaultClass)?"n":~t.indexOf(e["boolean"].defaultClass)?"b":~t.indexOf(e.date.defaultClass)?"d":""},dateNum:function(t,e){e&&(t+=1462);var n=Date.parse(t);return(n-new Date(Date.UTC(1899,11,30)))/864e5},createSheet:function(t){for(var e={},n={s:{c:1e7,r:1e7},e:{c:0,r:0}},r=u.prototype.types,s=0;s!==t.length;++s)for(var a=0;a!==t[s].length;++a){n.s.r>s&&(n.s.r=s),n.s.c>a&&(n.s.c=a),n.e.r<s&&(n.e.r=s),n.e.c<a&&(n.e.c=a);var i=t[s][a];if(i&&i.v){var l=o.utils.encode_cell({c:a,r:s});i.t||(r.number.assert(i.v)?i.t="n":r["boolean"].assert(i.v)?i.t="b":r.date.assert(i.v)?i.t="d":i.t="s"),"d"===i.t&&(i.t="n",i.z=o.SSF._table[14],i.v=this.dateNum(i.v)),e[l]=i}}return n.s.c<1e7&&(e["!ref"]=o.utils.encode_range(n)),e},Workbook:function(){this.SheetNames=[],this.Sheets={}},string2ArrayBuffer:function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),r=0;r!==t.length;++r)n[r]=255&t.charCodeAt(r);return e},export2file:function(t,e,s,a){if(o&&".xls"===a.substr(0,4)){var i=new this.Workbook,l=this.createSheet(t);i.SheetNames.push(s),i.Sheets[s]=l;var p={bookType:a.substr(1,3)+(a.substr(4)||"m"),bookSST:!1,type:"binary"},u=o.write(i,p);t=this.string2ArrayBuffer(u)}r(new n([t],{type:e+";"+this.charset}),s+a,!0)},LocalStorage:function(){this.type="localStorage",this.store=t[this.type],this.namespace="te",this.getKey=function(t){return this.namespace+t},this.setItem=function(t,e,n){var r=this.getKey(t);if(!this.exists(r)||n)return this.store.setItem(r,e)},this.getItem=function(t){var e=this.getKey(t);return this.store.getItem(e)},this.exists=function(t){var e=this.getKey(t);return null!==this.store.getItem(e)},this.removeItem=function(t){var e=this.getKey(t);return this.store.removeItem(e)},this.error=function(t){return new Error("unknown error occurred",t)}}};var f=u.prototype.LocalStorage;if(f._instance=null,f.getInstance=function(){return f._instance||(f._instance=new f),f._instance},e){e.fn.tableExport=function(t,e){return new u(this,t,e)};for(var c in u.prototype)e.fn.tableExport[c]=u.prototype[c]}return t["default"]=t.TableExport=u});
\ No newline at end of file
diff --git a/src/stable/typings/tableexport.d.ts b/src/stable/typings/tableexport.d.ts
index fabb472..2dad856 100644
--- a/src/stable/typings/tableexport.d.ts
+++ b/src/stable/typings/tableexport.d.ts
@@ -88,6 +88,12 @@ export class TableExport {
      */
     txt: TXT;
 
+    /**
+     * Cell-types override and assertion configuration
+     * @memberof TableExport.prototype
+     */
+    types: Types;
+
     /**
      * Escapes special characters with HTML entities
      * @memberof TableExport.prototype
@@ -96,6 +102,23 @@ export class TableExport {
      */
     escapeHtml: (string: string) => string;
 
+    /**
+     * Removes leading/trailing whitespace from cell string
+     * @memberof TableExport.prototype
+     * @param isTrimWhitespace {Boolean}
+     * @param string {String}
+     * @returns {String} trimmed string
+     */
+    formatValue: (string: string) => string;
+
+    /**
+     * Get cell data-type
+     * @memberof TableExport.prototype
+     * @param string {String}
+     * @returns {String} data-type
+     */
+    getType: (string: string) => string;
+
     /**
      * Formats datetimes for compatibility with Excel
      * @memberof TableExport.prototype
@@ -111,7 +134,7 @@ export class TableExport {
      * @param data {String}
      * @returns {Number} epoch time
      */
-    createSheet: (data: string) => number;
+    createSheet: (data: string) => void;
 
     /**
      * Converts a string to an arraybuffer
@@ -174,6 +197,7 @@ export interface Defaults {
     ignoreCols: number[];
     ignoreCSS: string;
     emptyCSS: string;
+    trimWhitespace: boolean;
 }
 
 /**
@@ -224,6 +248,22 @@ export interface TXT {
     fileExtension: string;
 }
 
+/**
+ * Cell-types override and assertion configuration
+ * @memberof TableExport.prototype
+ */
+export interface Types {
+    string: Type;
+    number: Type;
+    boolean: Type;
+    date: Type;
+}
+
+export interface Type {
+    defaultClass: string;
+    assert: (v: any) => boolean;
+}
+
 interface JQuery {
 
     /**