SOLUTION

You can use $() method to get access to all rows even not present in DOM and construct a new table using these rows. Then you can execute table2excel() on a newly constructed table to get Excel file that contains all rows.

For example:

$(function() {
   var startDate = $(".startDate").val();
   var endDate = $(".endDate").val();

   $("#exportExcel").click(function(){
      $('<table>')
         .append(
            $("#table_id").DataTable().$('tr').clone()
         )
         .table2excel({
            exclude: ".excludeThisClass",
            name: "Worksheet Name",
            filename: "SomeFile" //do not include extension
         });
   });

   $("#table_id").dataTable();
});

DEMO

See this page for code and demonstration.

NOTES

Excel 2013 displays the following error when opening the file produced by table2excel.js.

Excel cannot open the file [filename] because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.

Because of this error, I would rather use DataTables TableTools plug-in instead even though it can only produce CSV files and also uses Flash.

Answer from Gyrocode.com on Stack Overflow
🌐
Bootsnipp
bootsnipp.com › snippets › yyoZ1
Bootstrap Snippet Bootstrap 4 - DataTables with PDF, Excel Export Feature using HTML CSS Bootstrap jQuery
$(document).ready(function() { $('#table_id').DataTable({ dom: 'Bfrtip', responsive: true, pageLength: 25, // lengthMenu: [0, 5, 10, 20, 50, 100, 200, 500], buttons: [ 'copy', 'csv', 'excel', 'pdf', 'print' ] }); });
🌐
Prepbootstrap
prepbootstrap.com › bootstrap-template › table-export-to-excel
Export a Table to Excel Template | PrepBootstrap
This template shows a standard Bootstrap table containing some data, which is parsed by the ShieldUI's DataSource widget and exported to Excel using the Excel Export functionality provided by the same library.
🌐
DataTables
datatables.net › extensions › buttons › examples › styling › bootstrap4.html
DataTables example - Bootstrap 4
Advanced interaction features for your tables. ... Comprehensive editing library for DataTables. ... This example shows DataTables and the Buttons extension being used with the Bootstrap 4 framework providing the styling. ... new DataTable('#example', { layout: { topStart: { buttons: ['copy', 'excel', 'pdf', 'colvis'] } } });
🌐
Bbbootstrap
bbbootstrap.com › home › snippets › bootstrap 4 export table to excel file
Bootstrap 4 Export table to excel file Example
Bootstrap 4 Export table to excel file snippet for your project 📌📌. this snippet is created using HTML, CSS, Bootstrap 4, Javascript
🌐
Bootstrap Table
bootstrap-table.com › docs › extensions › export
Table Export · Bootstrap Table
Export data type, support: 'basic', 'all', 'selected'. ... Set true to export the table footer. ... Export types, support types: ['json', 'xml', 'png', 'csv', 'txt', 'sql', 'doc', 'excel', 'xlsx', 'pdf'].
🌐
DataTables
datatables.net › extensions › buttons › examples › initialisation › export.html
DataTables example - File export
Exporting data from a table can often be a key part of a complex application. The Buttons extension for DataTables provides three plug-ins that provide overlapping functionality for data export: HTML5 export buttons - makes use of HTML5 APIs to create files client-side ... Buttons provides button types that will alias HTML5 buttons. These are: copy, csv, excel, pdf.
🌐
GitHub
github.com › fg1998 › bootstrapExcelExport
GitHub - fg1998/bootstrapExcelExport: Bootstrap plugin to export html tables to excel · GitHub
This is a simple usage plugin to export HTML <table> to excel files. In fact, alow user to save html data to disk as a .xls file. It was developed with Twitter Bootstrap in mind, but you can use with regular html tables instead.
Starred by 4 users
Forked by 2 users
Languages   HTML
🌐
Bootsnipp
bootsnipp.com › snippets › D7MRz
Bootstrap Snippet Export table data to excel in csv format. using HTML CSS jQuery
<link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <container> <a href="#" class="export"><button type="button" class="btn btn-default btn-lg"><span class="glyphicon glyphicon-download-alt"></span> Export Table data into Excel </button></a> </container> <div id="dvData"> <table class="table table-condensed datatable table-bordered
Find elsewhere
🌐
MDBootstrap
mdbootstrap.com › standard › material design for bootstrap 5 & vanilla javascript
How to export data table to excel - Material Design for Bootstrap
General Bootstrap questions · Topic: How to export data table to excel · Mankongwatcharakul priority asked 6 years ago · I use datatable.net and I need to export to excel Could you help me please? Add comment · Jakub Mandra staff answered 6 years ago · 0 0 Best answer ·
🌐
Stack Overflow
stackoverflow.com › questions › 62889534 › export-all-records-to-excel-from-bootstrap-table
jquery - Export all records to excel from bootstrap table - Stack Overflow
<script src="~/wwwroot/plugins/bootstrap-table/bootstrap-table.js"></script> <script src="~/wwwroot/plugins/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.js"></script> <script src="~/wwwroot/plugins/bootstrap-table/extensions/export/bootstrap-table-export.js"></script> <script src="~/wwwroot/plugins/bootstraptable/extensions/export/tableExport.js"></script> ... You can set the exportDataType table option to all. You can test it on this example, just select select all on the selectbox, then export the data :-)
🌐
DataTables
datatables.net › extensions › buttons › examples › styling › bootstrap.html
DataTables example - Bootstrap 3
The DataTables / Bootstrap integration provides seamless integration for DataTables to be used in a Bootstrap page. Javascript · HTML · CSS · Ajax · Server-side script · Comments · The Javascript shown below is used to initialise the table shown in this example: $('#example').DataTable({ ...
🌐
YouTube
youtube.com › online web tutor
How To Add Export Buttons To Bootstrap Table | How To Use DataTable jQuery Plugin | PDF, CSV, Excel - YouTube
In this video we'll see:How To Add Export Buttons To Bootstrap Table | How To Use DataTable jQuery Plugin | PDF, CSV, Excel#onlinewebtutor​ #skillshikeJQuery...
Published   December 27, 2022
Views   6K
🌐
DataTables
datatables.net › extensions › buttons › examples › styling › bootstrap5.html
DataTables example - Bootstrap 5
Advanced interaction features for your tables. ... Comprehensive editing library for DataTables. ... This example shows DataTables and the Buttons extension being used with the Bootstrap 5 framework providing the styling. ... new DataTable('#example', { layout: { topStart: { buttons: ['copy', 'excel', 'pdf', 'colvis'] } } });
🌐
uiCookies
uicookies.com › home › blog › 30 bootstrap datatable examples for web tables 2026
30 Bootstrap Datatable Examples For Web Tables 2026 - uiCookies
March 24, 2026 - Apart from the regular options, this table also has other useful options like alert notification, table copy option, and export the table as an excel option. Defining row lines and alternate colors for the rows helps the user to easily identify the entries in the table. Plus, you also get the sorting option and dedicated search option to easily search and find the information you want. By making a few design adjustments, you can use this datatable in your web application and dashboards. ... The creator of this Bootstrap DataTable has given us a fully functional design.
🌐
Freetime Learning
freetimelearning.com › bootstrap-snippets › bootstrap-3-main-plugins.php
Bootstrap Snippets, Bootstrap Export Data Tables, Export pdf, excel, print, copy - Free Time Learning
Bootstrap Snippets, Bootstrap Export Data Tables, Export pdf, excel, print, copy - Free Time Learning, TutorialsPoint Plugins, Bootstrap Plugins, Snippets, Free W3Schools Bootstrap Plugins
🌐
DataTables
datatables.net › download › index
Download
Enhance HTML tables with advanced interaction controls. ... Add full editing controls to your DataTables. Editor is a commercial extension for DataTables, it requires a license to use it for longer than the free trial period. Please create an account or login to be able to include Editor in the package. ... Excel-like click and drag copying and filling of data.
🌐
DataTables
datatables.net › forums › discussion › 68680 › export-to-excel-with-bootstrap-switch-in-one-column
Export to Excel with bootstrap switch in one column — DataTables forums
I tried this nice workaround but I still have an empty value in Excel What I do which works perfectly well by the way is to change the input for a span and then change the span back to an input after export. For the purpose, I changed the bootstrapSwitch for a normal input type checkbox · TheTable.on('buttons-processing', function ( e, indicator, buttonApi, DataTable, node, config ) { if (indicator) { $(TableId).find('input:not(:hidden)').each(function() { $(this).parent().html("<span class='forexport'>" + this.value + "</span>"); }); } else { var RevertBackToInputTrue = "<input checked='chec
🌐
jQuery Script
jqueryscript.net › jquery plugins › jquery table plugins
Excel-like Bootstrap Table Sorting And Filtering Plugin | Free jQuery Plugins
excel-bootstrap-table-filter.js is a jQuery plugin that creates multiple filters in your Bootstrap table columns to narrow down or re-sort the tabular data just like in the MS Excel.
🌐
Stack Overflow
stackoverflow.com › questions › 67624491 › can-bootstrap-5-read-the-content-of-an-excel-table-and-display-it-inside-an-html
Can Bootstrap 5 read the content of an excel table and display it inside an HTML table? - Stack Overflow
The code examples also always required user input to pick an excel file. I instead am trying to determine if there is also someway for me to use an onload function to get the excel to load immediately when the page is opened to display the table.