Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chennanpo opened this issue Aug 30, 2019 · 2 comments
Open

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

chennanpo opened this issue Aug 30, 2019 · 2 comments

Comments

@chennanpo
Copy link

chennanpo commented Aug 30, 2019

<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>

@mohamdfoad
Copy link

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 

@mrmuminov
Copy link

exclude

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants