Comments (8)
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.
DV3 on Stackoverflow claims to have fixed this. We'll give him some time to submit a pull request.
from table-to-json.
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.
@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.
See PR #10
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.
@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.
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.
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)
- Can we have a little more explanation? HOT 2
- Adding additional data HOT 7
- Wrong version number in release 0.12.0 HOT 2
- To add <td id="value" in json data HOT 1
- Facing problem on the table with multiple tr in thead HOT 2
- value of select in cell HOT 1
- Issue when converting DropdownList to Json HOT 1
- Is it possible to extract all tables in HTML string? HOT 1
- Ability to include hidden columns HOT 2
- how to install package and which files do I need? HOT 2
- Can we get JSON for only selected rows of table? HOT 4
- Hi there :-) great library .. is there any chance it to have a reverse option ? HOT 1
- Can table conversion with input be supported? HOT 2
- <th> tags are missing HOT 3
- ignoreEmptyRows doesn't work in combination with ignoreColumns HOT 3
- empty data array when calling tableToJSON() on my table HOT 1
- Without jQuery and types HOT 1
- Empty response on hidden table
- Ignore the first row/th
- Typecast certain columns HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from table-to-json.