Git Product home page Git Product logo

Comments (8)

simonbengtsson avatar simonbengtsson commented on September 24, 2024

I'm working on better support for col and rowspans, in the meantime this is quite complicated. I think it would be possible to not override any rows by keeping track of the y pos that gets sent to the renderCell function and increase it sufficiently before drawing anything. I will look into this hopefully later today or this weekend if you have not solved it.

I have actually never used row- or colspan in a project, can you post what your data looks like so that I better can understand your use case?

from jspdf-autotable.

lobosan avatar lobosan commented on September 24, 2024

Hi Simon, thanks for your quick response. This is an abstract of my data. In some cases I have 60 objects and I need the sub headers to visualise groups of data, otherwise the readability isn't good.

In the meantime, do you think is a good idea to add a new object for each sub header that I want to add so then that will be replaced with the correct colspan format?

Thanks in advance for your help.

var data = [
    {title: "Fecha de creación", organization0: "2015-06-18", organization1: "2015-06-18"},
    {title: "Provincia", organization0: "Pichincha", organization1: "Imbabura"},
    {title: "Cantón", organization0: "Alausí", organization1: "Archidona"},
    {title: "Parroquia", organization0: "Achupallas", organization1: "Abdón Calderón"},
    {title: "Sector/es", organization0: "La Independencia", organization1: "La Independencia"},
    {title: "Nombre del grupo", organization0: "La lucha de los pobres", organization1: "Alternativas de desarrollo"},
    {title: "Representante", organization0: "Juan Guillén", organization1: "Juan Guillén"},
    // ADD SUB HEADER WITHOUT REPLACING A ROW
    {title: "Conocimientos de los pri...ales de la agroecología", organization0: 6, organization1: 9},
    {title: "Decisión política", organization0: 4, organization1: 6},
    {title: "Diseño de finca", organization0: 8, organization1: 8},
    {title: "Capacidades técnicas", organization0: 1, organization1: 6}
];

from jspdf-autotable.

simonbengtsson avatar simonbengtsson commented on September 24, 2024

Yes it sounds like a good idea to add extra objects for now. Is it something like this you want to accomplish with the subheader? Table with subheader

from jspdf-autotable.

lobosan avatar lobosan commented on September 24, 2024

Hi Simon, yes that's what I needed and I solved it adding a new object for each sub header. I reported another issue https://github.com/someatoms/jsPDF-AutoTable/issues/44 where you can see the screeshot. However the problem on that issue is about linebreak but still not able to solve it. Hope you can help me with that one.

Thanks in advance for your help

from jspdf-autotable.

thaneshgopal avatar thaneshgopal commented on September 24, 2024

Thank you for this plugin! I am having an issue where the pageBreak : 'avoid' option doesn't work. The following two tables comes up in two separate pages, I want to have it in the same page one after the other.
I am sure, I am missing something. Any help would be much appreciated.

    pdf.autoTable(descTitle,  descData, {
        startY: 30,
        pageBreak:'avoid'
       });

    pdf.autoTable(titles,  data, {
        startY: 150,
        pageBreak:'avoid'
      });
    pdf.save("Report.pdf");

from jspdf-autotable.

simonbengtsson avatar simonbengtsson commented on September 24, 2024

If you want the tables on the same page you should use pagebreak: 'auto'. This is the default value however. That doesn't work either?

from jspdf-autotable.

thaneshgopal avatar thaneshgopal commented on September 24, 2024

Thank you very much for the prompt reply Simon. Yes, it is working. sorry, I did not try that option before trying. It is a great plugin and I am sure many people would find it useful!

from jspdf-autotable.

simonbengtsson avatar simonbengtsson commented on September 24, 2024

No worries and thanks!

from jspdf-autotable.

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.