excel file is not opening when converting html table to excel RRS feed

  • Question

  • User-1634604574 posted

    i convert html table to excel file is not opening

    <table id="tb_export_customer_insert" border="1" >
    <tr class="noExl">




    exclude: ".noExl",

    name: "Worksheet Name",

    filename: "SomeFile" //do not include extension


    Sunday, May 26, 2019 6:46 PM

All replies

  • User665608656 posted

    Hi zhyanadil,

    According to your description and the code you provided, I suggest you could try to add $(function () {}) outside the jQuery method for exporting excel files .

    This means the export to excel codes will be executed when the document is loaded.

    Your table export Excel method does not trigger an action to execute, so it could not complete the action.

    For more details, you could refer to the following code:

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
        <script src="../jquery-table2excel-master/dist/jquery.table2excel.min.js"></script>
        <script type="text/javascript">
           $(function () {
                    exclude: ".noExl",
                    name: "Excel Document Name",
                    filename: "myFileName" + new Date().toISOString().replace(/[\-\:\.]/g, ""),
                    fileext: ".xls",
                    exclude_img: true,
                    exclude_links: true,
                    exclude_inputs: true
        <form id="form1" runat="server">
            <table class="table2excel" data-tablename="Test Table 1">
                    <tr class="noExl">
                        <td>This shouldn't get exported</td>
                        <td>This shouldn't get exported either</td>
                        <td>This Should get exported as a header</td>
                        <td>This should too</td>
                        <td>data1a with a <a href="#">link one</a> and <a href="#">link two</a>.</td>
                        <td>data1b with a
                            <img src="image_file.jpg" alt="image" />.</td>
                        <td>data2a with a
                            <input type="text" value="text value" />.</td>
                        <td>data2b with a
                            <input type="text" value="second text value" />.</td>
                        <td colspan="2">This footer spans 2 cells</td>

    The result of my work demo:

    Best Regards,


    Monday, May 27, 2019 5:56 AM