Giter Site home page Giter Site logo

Comments (8)

baw avatar baw commented on September 2, 2024

Thanks for your issue. One way I think this could be handled is by including a row/column that spans multiple rows/columns to all they span. Do you have any other ideas of how this could be handled?

from table-to-json.

lightswitch05 avatar lightswitch05 commented on September 2, 2024

DV3 on Stackoverflow claims to have fixed this. We'll give him some time to submit a pull request.

from table-to-json.

Mottie avatar Mottie commented on September 2, 2024

It messes up even worse if the thead has multiple rows (demo):

<table border="1" id="example-table">
    <thead>
        <tr>
            <th rowspan="2">line</th>
            <th colspan="2">values</th>
        </tr>
        <tr>
            <th>value1</th>
            <th>value2</th>
        </tr>
    </thead>
    <tbody>
        ...
    </tbody>
</table>

from table-to-json.

lightswitch05 avatar lightswitch05 commented on September 2, 2024

@Mottie - you might be able to fix the headings by using the headings option. You just pass in an array of the headings you want and it will use those over any headings defined in the table. But obviously support for rowspan and colspan is needed.

from table-to-json.

Mottie avatar Mottie commented on September 2, 2024

See PR #10

Updated demo

Note: I just realized I didn't test to make sure this change will work if the first column of a colspan is set to be a hidden column...

from table-to-json.

lightswitch05 avatar lightswitch05 commented on September 2, 2024

@Mottie, your PR has been merged and released in v0.8.0. If you would like to add more tests and help out with future features/bugs I've added you as a Collaborator to the project

from table-to-json.

Mottie avatar Mottie commented on September 2, 2024

Thanks, I appreciate that!

After working to incorporate the same code I added into a tablesorter widget, I discovered that it doesn't correctly parse a cell with both a rowspan and colspan. It'll take a bit more tweaking to get it to work properly. So until then, I wanted to make sure everyone was aware of this limitation.

from table-to-json.

Mottie avatar Mottie commented on September 2, 2024

Added support to allow for cells that have both a rowspan and a colspan in 9f80cef. I still haven't had a chance to look into making it work with hidden columns.

from table-to-json.

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.