Git Product home page Git Product logo

table-builder's Issues

Not working in browser

It does not work in browser, I have added the tablebuilder.js to my assets, copied from node_modules as you describe. I get Uncaught ReferenceError: Table is not defined
Call is (new Table({ 'class': 'some-table' })) .setHeaders(headers).setData(data).render()

Remove tfoot if not needed

Thanks for this library! I was thinking of building it myself but you've gotten off to a good start.

I'd like to contribute, but just have a small request for now so I'll paste it as an issue.

In your buildFooter function, if no totals are used, there is a blank <tfoot></tfoot> added. This doesn't look great on tables with borders as it appears to be a blank row. Add this patch to the buildFooter function to return an empty string:

        if (content.length > 2) {
          return '<tfoot><tr>' + content.join('') + '</tr></tfoot>';
        } else {
          return ''
        }

Preserve property keys as cell class names

This is such a beautiful library, thank you. Noticed that the class names for the td cells substitue underscores in the property name to hyphens.

In my data, the property name is mla_name but in the html I can see the td class set to mla-name-td

screen shot 2018-11-15 at 4 36 01 pm

It would be a lot more convenient if the property name mla_name was preserved as the class names for consistency.

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.