GithubHelp home page GithubHelp logo

Multiple Tables about jquery-table2excel HOT 7 OPEN

rainabba avatar rainabba commented on June 19, 2024 5
Multiple Tables

from jquery-table2excel.

Comments (7)

mueller90 avatar mueller90 commented on June 19, 2024 1

I had the same issue. I tried going around it by wrapping another table around my tables which didn't work as expected. So I manually added a bit of code into jquery.table2excel.min.js.

From:

...
$(e.element).each(function (i, o) {
   var tempRows = "";

   $(o).find("tr").not(e.settings.exclude).each(function (i, p) {
...

to:

...
$(e.element).each(function (i, o) {
   var tempRows = "";
   var $tableRow = $(o).find("tr");

   if($(o).find("table").length) {
      $tableRow = $(o).find("table").find("tr");
   }

   $tableRow.not(e.settings.exclude).each(function (i, p) {
...

It's not very pretty but enough in my case.

from jquery-table2excel.

misvijay avatar misvijay commented on June 19, 2024

@khamarzama Check out the index.html under demo folder. Instead of using the table id you can assign a css class to all of the tables you want to export and call the table2excel with that css class. I haven't tested it personally but based on the demo source and the change log, I hope that will work.

from jquery-table2excel.

macieljr avatar macieljr commented on June 19, 2024

Just tried to use a class name to select multiple tables and it's not working. Even the demo is not working as expected, anymore.

from jquery-table2excel.

vietnguyen1992 avatar vietnguyen1992 commented on June 19, 2024

No answer for this question, i have the same issue :(

from jquery-table2excel.

PamelaN426 avatar PamelaN426 commented on June 19, 2024

@mueller90 Your solution worked PERFECTLY! I also had a page with multiple tables on it and decided to wrap them all in a single table so I could get them all to export. But it did some weird things and duplicated data. I implemented your solution and it worked exactly as I needed it to. You are a life-saver! Can't tell you how many hours I wasted struggling with this until I came across your solution. THANK YOU!!!!

from jquery-table2excel.

rainabba avatar rainabba commented on June 19, 2024

@mueller90 If you go to the original file (not the resulting min.js) on this site (here), then hit "edit", GitHub will make it dead easy for you to "submit a PR" (pull request) with the proposed changes and you'll never leave the browser. Of course, you would ideally fork to your account, clone to a workspace (GitPod is awesome), make the change, test, build, commit, push, then come back to your fork of the project on GitHub and hit the button to "Submit a PR" and finish that quick process.

If nobody is interested, I'll see about integrating this later. I wish someone had told me the above years sooner, which is why I took the time to share it :)

from jquery-table2excel.

PamelaN426 avatar PamelaN426 commented on June 19, 2024

@mueller90, I have another issue where I have a table that I want to export but as soon as the user added embedded tables within a cell, the resulting Excel file appears blank. As soon as we remove the embedded table it is fine. I tried adding the noExl class to the rows in the embedded table, but it didn't seem to work. Anyone have any insight into this issue?

from jquery-table2excel.

Related Issues (20)

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.