jquery-table2excel icon indicating copy to clipboard operation
jquery-table2excel copied to clipboard

[display: none;] <- it had no effect.?????

Open chennanpo opened this issue 6 years ago • 2 comments

<tr class="noExl"> <td>100</td> <td>200</td> <td>300</td> </tr> <tr> <td>400</td> <td>500</td> <td>600</td> </tr> <tr style="display:none"> <td>700</td> <td>800</td> <td>900</td> </tr>

chennanpo avatar Aug 30 '19 10:08 chennanpo

Hi I have solved your issue by modifying the code in the table2excel.js file yu can replace infile between // comments!

        // get contents of table except for exclude
        $(e.element).each(function (i, o) {
            var tempRows = "";
            var elecontent
             $(o).find("tr").not(e.settings.exclude).each(function (i, p) {
                // console.log(o);
            if (document.getElementById("mydesiredtable").rows.item(i).style.display == "none") {
                
            }
            else
            {
                tempRows += "<tr>";
                $(p).find("td,th").not(e.settings.exclude).each(function (i, q) { // p did not exist, I corrected

                    var rc = {
                        rows: $(this).attr("rowspan"),
                        cols: $(this).attr("colspan"),
                        flag: $(q).find(e.settings.exclude)
                    };

                    if (rc.flag.length > 0) {
                        tempRows += "<td> </td>"; // exclude it!!
                    } else {
                        if (rc.rows & rc.cols) {
                            tempRows += "<td>" + $(q).html() + "</td>";
                        } else {
                            tempRows += "<td";
                            if (rc.rows > 0) {
                                tempRows += " rowspan=\'" + rc.rows + "\' ";
                            }
                            if (rc.cols > 0) {
                                tempRows += " colspan=\'" + rc.cols + "\' ";
                            }
                            tempRows += "/>" + $(q).html() + "</td>";
                        }
                    }
                });

                tempRows += "</tr>";
                //console.log(tempRows);
                }
            });
            // exclude img tags 

mohamdfoad avatar Mar 11 '20 13:03 mohamdfoad

exclude

there is such a parameter it’s nice to see what it’s all about

mrmuminov avatar Oct 23 '20 11:10 mrmuminov