Coder Social home page Coder Social logo

Comments (5)

rgavrilov avatar rgavrilov commented on July 20, 2024

I'm getting the same behavior. Apparently bug is caused by fnCalcColRatios function, which calculates invisible column width as 0:

iWidth = aoCols[i].nTh.offsetWidth;

Not sure what the good fix would be though, to get proper width we need to render the column, i.e. make it visible.

from tabletools.

 avatar commented on July 20, 2024

Hmmm - tricky one. Note sure what the correct thing to do is either. Possibly calculate the widths based on the content of the headers (strlen)... What I really would like is for the PDF generator to figure it out, but it doesn't seem to work that way.

from tabletools.

afshinm avatar afshinm commented on July 20, 2024

Any update on this?

from tabletools.

 avatar commented on July 20, 2024

Sorry no. I've not had time to work on it yet.

from tabletools.

EverpathDano avatar EverpathDano commented on July 20, 2024

A hack, super easy, super fast, "at least it looks better than terrible" workaround until someone figures out something better:

iWidth = aoCols[i].nTh.offsetWidth;
if (!iWidth && typeof iDTTTDefaultHiddenColumnWidth !== 'undefined') {
    iWidth = iDTTTDefaultHiddenColumnWidth;
}

then we set the variable in the global scope to have a reasonable default (we have one table per page, we tune to that specific table). Even simpler could be iWidth = aoCols[i].nTh.offsetWidth || 200;.

I know, I know, it's hideous and horrible, I'm not suggesting this as a change to the mainline. It has the advantage of getting us up and running again without rolling our own PDF generator, I figured I'd pass it along to other desperate coders. :-)

from tabletools.

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.