Giter Site home page Giter Site logo

clarketm / tableexport Goto Github PK

View Code? Open in Web Editor NEW
882.0 52.0 292.0 3.5 MB

The simple, easy-to-implement library to export HTML tables to xlsx, xls, csv, and txt files.

Home Page: https://tableexport.travismclarke.com/

License: Apache License 2.0

JavaScript 87.02% CSS 3.35% HTML 9.61% Shell 0.02%
jquery jquery-plugin javascript excel csv txt xlsx xls export html-table

tableexport's Introduction

TableExport

NPM release Build Status Downloads License

Docs

Getting Started

Install manually using <script> tags

To use this library, include the FileSaver.js library, and TableExport library before the closing <body> tag of your HTML document:

<script src="FileSaver.js"></script>
...
<script src="tableexport.js"></script>

Install with Bower

$ bower install tableexport.js

Install with npm

$ npm install tableexport

CDN

uncompressed compressed
CSS 🔗 🔗
JS 🔗 🔗
Images 🔗xlsx🔗xls🔗csv🔗txt

Dependencies

Required:

Optional:

Add-Ons:

In order to provide Office Open XML SpreadsheetML Format ( .xlsx ) support, you must include the following third-party library in your project before both FileSaver.js and TableExport.

Including xlsx.core.js is NOT necessary if installing with Bower or npm

<script src="xlsx.core.js"></script>
<script src="FileSaver.js"></script>
...
<script src="tableexport.js"></script>

Older Browsers:

To support legacy browsers ( Chrome < 20, Firefox < 13, Opera < 12.10, IE < 10, Safari < 6 ) include the Blob.js polyfill before the FileSaver.js script.

  • Blob.js by eligrey (forked by clarketm)

Including Blob.js is NOT necessary if installing with Bower or npm

<script src="Blob.js"></script>
<script src="FileSaver.js"></script>
...
<script src="tableexport.js"></script>

Usage

JavaScript

To use this library, simple call the TableExport constructor:

new TableExport(document.getElementsByTagName("table"));

// OR simply

TableExport(document.getElementsByTagName("table"));

// OR using jQuery

$("table").tableExport();

Additional properties can be passed-in to customize the look and feel of your tables, buttons, and exported data.

Notice that by default, TableExport will create export buttons for three different filetypes xls, csv, txt. You can choose which buttons to generate by setting the formats property to the filetype(s) of your choice.

/* Defaults */
TableExport(document.getElementsByTagName("table"), {
  headers: true,                      // (Boolean), display table headers (th or td elements) in the <thead>, (default: true)
  footers: true,                      // (Boolean), display table footers (th or td elements) in the <tfoot>, (default: false)
  formats: ["xlsx", "csv", "txt"],    // (String[]), filetype(s) for the export, (default: ['xlsx', 'csv', 'txt'])
  filename: "id",                     // (id, String), filename for the downloaded file, (default: 'id')
  bootstrap: false,                   // (Boolean), style buttons using bootstrap, (default: true)
  exportButtons: true,                // (Boolean), automatically generate the built-in export buttons for each of the specified formats (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(s) (default: null)
  ignoreCols: null,                   // (Number, Number[]), column indices to exclude from the exported file(s) (default: null)
  trimWhitespace: true,               // (Boolean), remove all leading/trailing newlines, spaces, and tabs from cell text in the exported file(s) (default: false)
  RTL: false,                         // (Boolean), set direction of the worksheet to right-to-left (default: false)
  sheetname: "id"                     // (id, String), sheet name for the exported spreadsheet, (default: 'id')
});

Note: to use the xlsx filetype, you must include js-xlsx; reference the Add-Ons section.

Properties

Methods

TableExport supports additional methods (getExportData, update, reset and remove) to control the TableExport instance after creation.

/* First, call the `TableExport` constructor and save the return instance to a variable */
var table = TableExport(document.getElementById("export-buttons-table"));
/* get export data */
var exportData = table.getExportData(); // useful for creating custom export buttons, i.e. when (exportButtons: false)

/*****************
 ** exportData ***
 *****************
{
    "export-buttons-table": {
        xls: {
            data: "...",
            fileExtension: ".xls",
            filename: "export-buttons-table",
            mimeType: "application/vnd.ms-excel"
        },
        ...
    }
};
*/
/* convert export data to a file for download */
var exportData = table.getExportData(); 
var xlsxData = exportData.table.xlsx; // Replace with the kind of file you want from the exportData
table.export2file(xlsxData.data, xlsxData.mimeType, xlsxData.filename, xlsxData.fileExtension, xlsxData.merges, xlsxData.RTL, xlsxData.sheetname)
var tableId = "export-buttons-table";
var XLS = table.CONSTANTS.FORMAT.XLS;

/* get export data (see `getExportData` above) */
var exportDataXLS = table.getExportData()[tableId][XLS];

/* get file size (bytes) */
var bytesXLS = table.getFileSize(exportDataXLS.data, exportDataXLS.fileExtension);

/**********************************
 ** bytesXLS (file size in bytes)
 **********************************
352
*/
/* update */
table.update({
  filename: "newFile" // pass in a new set of properties
});
/* reset */
table.reset(); // useful for a dynamically altered table
/* remove */
table.remove(); // removes caption and buttons

Settings

Below are some of the popular configurable settings to customize the functionality of the library.

/**
 * CSS selector or selector[] to exclude/remove cells (<td> or <th>) from the exported file(s).
 * @type {selector|selector[]}
 * @memberof TableExport.prototype
 */

// selector
TableExport.prototype.ignoreCSS = ".tableexport-ignore";

// selector[]
TableExport.prototype.ignoreCSS = [".tableexport-ignore", ".other-ignore-class"];

// OR using jQuery

// selector
$.fn.tableExport.ignoreCSS = ".tableexport-ignore";

// selector[]
$.fn.tableExport.ignoreCSS = [".tableexport-ignore", ".other-ignore-class"];
/**
 * CSS selector or selector[] to replace cells (<td> or <th>) with an empty string in the exported file(s).
 * @type {selector|selector[]}
 * @memberof TableExport.prototype
 */

// selector
TableExport.prototype.emptyCSS = ".tableexport-empty";

// selector[]
TableExport.prototype.emptyCSS = [".tableexport-empty", ".other-empty-class"];

// OR using jQuery

// selector
$.fn.tableExport.emptyCSS = ".tableexport-empty";

// selector[]
$.fn.tableExport.emptyCSS = [".tableexport-empty", ".other-empty-class"];
/* default charset encoding (UTF-8) */
TableExport.prototype.charset = "charset=utf-8";

/* default `filename` property if "id" attribute is unset */
TableExport.prototype.defaultFilename = "myDownload";

/* default class to style buttons when not using Bootstrap or the built-in export buttons, i.e. when (`bootstrap: false` & `exportButtons: true`)  */
TableExport.prototype.defaultButton = "button-default";

/* Bootstrap classes used to style and position the export button, i.e. when (`bootstrap: true` & `exportButtons: true`) */
TableExport.prototype.bootstrapConfig = ["btn", "btn-default", "btn-toolbar"];

/* row delimeter used in all filetypes */
TableExport.prototype.rowDel = "\r\n";
/**
 * Format-specific configuration (default class, content, mimeType, etc.)
 * @memberof TableExport.prototype
 */
formatConfig: {
    /**
     * XLSX (Open XML spreadsheet) file extension configuration
     * @memberof TableExport.prototype
     */
    xlsx: {
        defaultClass: 'xlsx',
        buttonContent: 'Export to xlsx',
        mimeType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
        fileExtension: '.xlsx'
    },
    xlsm: {
        defaultClass: 'xlsm',
        buttonContent: 'Export to xlsm',
        mimeType: 'application/vnd.ms-excel.sheet.macroEnabled.main+xml',
        fileExtension: '.xlsm'
    },
    xlsb: {
        defaultClass: 'xlsb',
        buttonContent: 'Export to xlsb',
        mimeType: 'application/vnd.ms-excel.sheet.binary.macroEnabled.main',
        fileExtension: '.xlsb'
    },
    /**
     * XLS (Binary spreadsheet) file extension configuration
     * @memberof TableExport.prototype
     */
    xls: {
        defaultClass: 'xls',
        buttonContent: 'Export to xls',
        separator: '\t',
        mimeType: 'application/vnd.ms-excel',
        fileExtension: '.xls',
        enforceStrictRFC4180: false
    },
    /**
     * CSV (Comma Separated Values) file extension configuration
     * @memberof TableExport.prototype
     */
    csv: {
        defaultClass: 'csv',
        buttonContent: 'Export to csv',
        separator: ',',
        mimeType: 'text/csv',
        fileExtension: '.csv',
        enforceStrictRFC4180: true
    },
    /**
     * TXT (Plain Text) file extension configuration
     * @memberof TableExport.prototype
     */
    txt: {
        defaultClass: 'txt',
        buttonContent: 'Export to txt',
        separator: '  ',
        mimeType: 'text/plain',
        fileExtension: '.txt',
        enforceStrictRFC4180: true
    }
},

//////////////////////////////////////////
// Configuration override example
//////////////////////////////////////////

/* Change the CSV (Comma Separated Values) `mimeType` to "application/csv" */
TableExport.prototype.formatConfig.xlsx.mimeType = "application/csv"

CSS

TableExport packages with customized Bootstrap CSS stylesheets to deliver enhanced table and button styling. These styles can be enabled by initializing with the bootstrap property set to true.

TableExport(document.getElementsByTagName("table"), {
  bootstrap: true
});

When used alongside Bootstrap, there are four custom classes .xlsx, .xls, .csv, .txt providing button styling for each of the exportable filetypes.

Browser Support

Chrome Firefox IE Opera Safari
Android - -
iOS - - -
Mac OSX -
Windows

A full list of browser support can be found in the FileSaver.js README. Some legacy browsers may require an additional third-party dependency: Blob.js

Examples

Customizing Properties

Customizing Settings

Miscellaneous

Skeletons

License

TableExport is licensed under the terms of the Apache-2.0 License

Going Forward

TODOs

  • Update JSDocs and TypScript definition file.
  • Fix bug with CSV and TXT ignoreRows and ignoreCols (rows/cols rendered as empty strings rather than being removed).
  • Reimplement and test the update, reset, and remove TableExport prototype properties without requiring jQuery.
  • Make jQuery as peer dependency and ensure proper TableExport rendering in browser, AMD, and CommonJS environments.
  • Force jQuery to be an optionally loaded module.
  • Use the enhanced SheetJS xls, csv, and txt formats (exposed via enforceStrictRFC4180 prototype property).
  • Allow ignoreCSS and emptyCSS to work with any selector|selector[] instead of solely a single CSS class.
  • Ensure (via testing) full consistency and backwards-compatibility for jQuery.
  • Add Export as PDF support.

Credits

Special thanks the the following contributors:

tableexport's People

Contributors

clarketm avatar jrejaud avatar peterdavehello avatar pierresh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tableexport's Issues

export all data

any possible to export all data?because i only can export current pages

Missing/invalid definitions for TypeScript

I've spotted some missing or invalid definitions for Typescript:

  • getExportData method is missing in TableExport class
  • tableexport method should be tableExport in JQuery interface
  • headings property of Defaults object should be headers

I haven't checked the whole .d.ts file yet.

Possible to export hidden rows?

Looking at the docs I see that you can specify ignoreCSS and ignoreRows. I haven't entered values for either of these but when I export my table, rows that have display:none set are not being exported. It looks like the default value for ignoreCSS is tableexport-ignore, but I don't have that set anywhere either.

How can I export rows that have display:none set?

Exporting TableSorter Data (TFooter & Filter Exclusion)

Is there any way to identify elements that should be ignored? I use TableSorter and currently the tfoot (added prior to tbody), filter & pagination header rows are included in the export.

I believe that TableSorter adds a tablesorter-ignoreRow class to rows that should be ignored, but it'd be nice to specify TR classes that should be ignore from the generated export.

Tfoot is normally added above the tbody and is a simple repeat of the thead. Using TableExport results in generating a double header (separated by an empty row for the dynamic filters). Any way to ignore this?

Merge columns and rows (xlsx)

Hello everybody,

I have a problem,
The plugin is treating the colspan and the rowspan, but does not deal with the merger between the columns and rows.

I am appreciated for your efforts to create this plugin (clark), thanks.

Extra spaces added to the cell which makes the column looks empty.

I have been trying recreate the same issue on a fiddler to explain the problem but a different problem is preventing me from doing so. Here is the fiddle to give you at least the html code that I am using https://jsfiddle.net/DTcHh/28806/

Here is a screenshot of the exact file the I downloaded "Columns D-Q appears to be empty columns"

screenshot_1

After expanding column "F" or any column between D-Q you'll see the data.

screenshot_2

Also, you may want to convert any <br> or <br /> to a new line when exporting html code.

It is not support Chinese?

I tryed many plugins,yours is the best,I think. but it not support chinese, will you fix this problem?

Export table with data via JSON URL

I am currently working with a table of over 1000 rows and 1000 columns. I am loading the rows of this table by JSON using the Bootstrap table extension: https://github.com/wenzhixin/bootstrap-table.
It's very hard for the browser to render the data from the HTML table and put it in the data-fileblob attribute every time I change the size of rows per page or refresh this huge table dynamically.
Is it possible to point table data via URL in settings to use remote JSON?

My Bootstrap Table Extension code:

    $table.bootstrapTable({
        url: '/result/data/',

        // Pagination
        pagination: true,
        pageSize: 100,
        pageList: [100, 500, 1000],
        sidePagination: 'server'

        // Toolbar
        toolbar: '#toolbar',
        showRefresh: true,
        showColumns: true,

        onLoadSuccess: function(data){
            // $table.tableExport.export(data); ?
            $("caption.btn-toolbar").remove();
            $table.tableExport({
                formats: ["xlsx"],
                position: "top"
            });
        }
    });

(Sorry my bad english. I'm brazilian)

utf8 encoding

hello, i have problem with encoding, when i try to export table to xsl spreadsheet. When i have in table words that contains ľčščžýá it replaces it with weird characters. I know it is an encoding issue. I also tried to set default parameter $.fn.tableExport.charset = "charset=utf-8"; but this didnt help me.

Arabic language

Hi and thanks for this nice plugin , everything worked perfect except when I have some fields with Arabic language the excel file will read this Arabic words like "العبرية" , please is there any way to solve this problem ,
Thanks again.

Input value

I use your plugin, it is easy compared to other plug-in, but I have a problem, it does not retrieve the value of an input text in a td.

Cheers and thank you for your time!

paging table exports and filtering

Hi,
I am using your nice export js in combination with datatables.net js. The exported xlsx file only have the first page data and filtered results are not exported as expected.
Would you please show me how to achieve export all pages from Datatable and only the filtered data?

Dynamically created table not working

Hi,

I have a table with fixed thead on html and row appended dynamically by JS. Exporting files return only thead and dynamically appended rows are not exported.

var liveTableData = $("#liveTable").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: ["xlsx", "xls", "csv", "txt"],    // (String[]), filetypes for the export
    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
    ignoreCols: null                   // (Number, Number[]), column indices to exclude from the exported file
    ignoreCSS: ".tableexport-ignore"   // (selector, selector[]), selector(s) to exclude from the exported file
});

/* update */
liveTableData.update();

/* reset */
liveTableData.reset();

/* remove */
liveTableData.remove();

export xls with a image

Hi does this library allow me to export a xls with a image somewhere on the sheet? if there are any jsfiddles on the web showing this it would also be great..
thanks
James

Not able to sum number

When i am downloading table with numeric value it show "the number in the cell is formatted as text or preceded by an apostrophe" in downloaded excel it should be number format so i can do grouping, sum and all..

Post back occurs in asp.net web page

I am fetching a table through jQuery AJAX and then invoke this plugin on the fetched table, it displays the export options as expected. However when I click on it, a post back occurs and the fetched table clears off. Is there a way this plugin may still export without triggering a post back.

Error jszip is not a constructor

Hello there!

I'm tried to use this plugin in ember and install it with bower.
After inputting app.import in ember-cli-build.js and calling it via constructor I got an error 'jszip is not a constructor'.
Did I do something wrong in installation?
Or should I use it in specific way?

Can i change position of export buttons other than top/bottom?

Seems there are 2 options to position default export buttons (Top/Bottom).
Is there a way i could position them anywhere else on the page, like may be in another div on the top of the page ?

This would be in a way resolved by: #40
But i was wondering if there is already an option for it ? I would like to use the existing export buttons.

exporting only filtered data

Hi,
Let's imagine there is a table with some filtering options enabled. If some filters are selected, table is going to reduce its size. I can't find a way to export only remained data, after the filtering is applied?

Customize button

Hello,

I am looking for a way to override default css bootstrap classes and button content, without modifying the source of the plugin.

Per example, I am looking for a way to override the class btn-default with btn-link in the settings of TableExport. I saw that the following method is described in the documentation, but I made some tests and it seems it does not hava any effect, wherever I put it in my script (befaire initializing TableExport or after):
$.fn.tableExport.bootstrap = ["btn", "btn-link", "btn-toolbar"];

Same for this method, where I just replaced the buttonContent text for localization reason:

$.fn.tableExport.xlsx = {
    defaultClass: "xlsx",
    buttonContent: "Excel",
    mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
    fileExtension: ".xlsx"
};

Could you please let me know how to use these 2 methods?

Thanks!

integration with webpack?

Hello,

I tried using this with webpack but I can't figure out how.
In the config entry I've put to import these libraries in the vendor.

    'tableexport',
    'file-saver',
    'xlsx'

I imported jQuery so that angular knows about it.
It reaches the statement in the library.

$.fn.tableExport = function (options, isUpdate) {
            return new TableExport(this, options, isUpdate);
        };

But in my directive it dumps because tableExport is not defined.

link: function ($scope, elm, attr) {
   elm.tableExport()
}

Do you have an example on how to integrate tableexport with webpack and angular?

Thanks,
George

Custom Button/Triggers

I use TableSorter http://mottie.github.io/tablesorter/ and a couple of other libraries (buttons, FontAwesome, contextMenu), but not BootStrap. I'd prefer to use pre-existing UI to add triggers anywahre; in a sub-menu, right-click context menu, etc. The current plugin adds button-styled AHREF links to potentially pre-existing table captions and doesn't look good.

tablesorter_tableexport

I can add CSS to hide AHREFs in the table caption and then used jQuery to trigger/click the invisible links, but the only trigger that functions is XLSX. Other links require using location.href.

/* This method won't work well if there are multiple TableExport plugins being used on a page. It's only a basic example. */
<script type="text/javascript">
$(function(){
    $('#exportBtns').on('click', 'a', function(e){
        var hiddenBtn = $('a.button-default.'+ $(this).data('click')).first();
        e.preventDefault();
        if (hiddenBtn.attr('href') == '#'){
            hiddenBtn.trigger('click');
        } else {
            location.href = hiddenBtn.attr('href');
        }
    });
});
</script>

<style type="text/css">
a.button-default {display:none !important;} /* hide TableExport caption buttons */
</style>

<span id="exportBtns" class="button-dropdown" data-buttons="dropdown">
    <button class="button">Export</button>
    <ul class="button-dropdown-list">
        <li><a href="#" data-click="xlsx">XLSX</a></li>
        <li><a href="#" data-click="xlx">XLS</a></li>
        <li><a href="#" data-click="csv">CSV</a></li>
        <li><a href="#" data-click="txt">TXT</a></li>
    </ul>
</span>

What's the best way to do this without modifying the plugin?

Have you considered making it so that the triggers can be specified? Or add methods to initiate the downloads?

Apply style in excel.

I am generating the XLSX formate of excel , I want to use same style which I have received from HTML string.
Please suggest Its important for me.

Data exported should be different than the td text

Hi, I'have found that the data exported is in fact the td contents and there's no way to tell the table export that the value to be exported should be another (for example a data-value attribute on each td with a fall-back to the td's text)

I'm formatting the numbers with the Spanish format (dots are thousand separators and commas are decimal separators).

So, when exporting to excel, the values are not recognized as numbers.

What I would like to do is add the value to a data attribute on each td and that value goes to excel instead of the td text.

such as:
<td data-value="1526.56">1.526,56</td>

Btw this should be very usefull in many other scenarios.

Any help on this?

Force Download

The "txt" format opens a plain text page instead of a forced download. The "xlsx" export provides me with a default option to "open" the file, but when I do that, there's nothing displayed... it must be saved first.

I normally use the application/unknown mime type to force downloads regardless of the file extension. Could you add an option to force an unknown" mime type and save instead of hoping that the user is knowledgeable enough not to try "opening" it each time? (Otherwise, I'll get multiple reports from users indicating that they found a new web application error.)

i am confused with the usage of tableexport

forgive my poor english;
i am confused with the usage of tableexport:

  • i must use it with the four default buttons ?
  • has it provide some api for me to pass the data and generate the file and donwload it ?
  • just like T.parse(data).save('filename','xls')

and actually it is very useful ,because generate a xecel file is rather rough with xlxs.js.
so , thanks for share this

@PeterDaveHello @clarketm

Rowspan and Colspan

The problem with several rowspan and colspan, is fix ?

In my case, I have several rowspan and colspan in the same table, and this is fill using AngularJS, and when export, in xlsx, the table not appear in correct way.

(sorry for my english, not is very good)

Use Table Export button to perform another function before exporting the Table

I am using Table Export to export the HTML table to an .xlsx file. The issue comes when my table has a character like "/" followed by a number. On the excel sheet it changes them to special characters.

image

Is there anyway I can avoid that. If not I want to add space between the "/" and the number. And I want to do that by clicking on the "Export to xlsx" button which is created by tableexport.js. I want the click function to change that on the table and then export to excel.

Here is my code so far:

HTML

<table class="request-table" border="1">
<tr>
    <th>Column 1</th>
    <th>Column 2</th>
    <th>Column 3</th>
</tr>
<tr>
    <td>Downton /4bbey</td>
    <td>D/3xter</td>
    <td>/1Zombie</td>
</tr>
<tr>
    <td>Chuc/5</td>
    <td>Fr/1ng/e</td>
    <td>/Breaking /6ad</td>
</tr>
</table>

jQuery

$(".addSpace").each(function() {
                var text = $(this).text();
                $(this).text(text.replace(/\//g, '/ ')); 
        });

$(".request-table").tableExport({
    bootstrap: false,
    formats: [ "xlsx"]
   });

Here is my Fiddle

Please Help!

How to apply styles to excel file?

When saving to the xlsx format, how do I ensure the same styles are carried over? I've used both inline styling, and external styling and neither seem to work.

It is exporting first page of table only

Hi,

I have a table which has the pagination. It contains 100 pages. This plugin is exporting only first page records. Please help me, I need to export all the records from 100 pages.

Thanks

Please correct bower.json

The dependency on xlsx-js should be js-xlsx. This is causing issues when js-xlsx needs to be updated locally.

Why my button is always on the top of table?

I am using TableExport.js v3.2.5.

The download button is always on the top of table even I set the settings clearly.

The library is simple to use, but it could be perfect if I can customize it more flexibly.

Thanks for your work! 👍

Problem with accents with .xls

Problems to open with Excel, when I try to export a table to xls (not with .xlsx). This is the button after call to the tableExport() function :

<button data-fileblob="{&quot;data&quot;:&quot;\t2010 - 2011\t2011 - 2012\t2012 - 2013\t2013 - 2014\t2014 - 2015\r\nPlaces ofertes\t-\t-\t-\t-\t-\r\nDemanda primera opció\t-\t-\t-\t-\t-\r\nEstudiants de nou ingrés\t-\t-\t-\t-\t-\r\nPercentatge d’accés en primera opció\t-\t-\t-\t-\t-\r\nPercentatge d’accés al setembre\t-\t-\t-\t-\t-\r\nEstudiants matriculats\t-\t-\t-\t-\t-\r\nEstudiants graduats\t-\t-\t-\t-\t-&quot;,&quot;fileName&quot;:&quot;tableE11G&quot;,&quot;mimeType&quot;:&quot;application/vnd.ms-excel&quot;,&quot;fileExtension&quot;:&quot;.xls&quot;}" class="btn btn-default xls"><i class="fa fa-file-excel-o" aria-hidden="true" data-toggle="tooltip" title="" data-original-title="Exportar taula a Excel" aria-describedby="tooltip238318"></i></button>

I tried to change the $.fn.tableExport.charset, but it don't work, the output file always have utf-8 encoding (I think that is problem of fileSaver.js plugin).

I solve the problem with the accents when I add in the tableexport.js in the saveAs this solution eligrey/FileSaver.js#28. But then the problem is that all the excel is viewed in only one column.
My "change" that don't work at all :

saveAs(new Blob(["\uFEFF" + data], {type: mime + ";" + $.fn.tableExport.charset}), name + extension);

Ignore columns by name

Support ignoring collumn not only by its number but also by its name, defined on th by attribute data-field. For example <th data-field="Name">Name</th>.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.