Skip to content

Added preserving thead and tfoot in tables - Issue #180#219

Merged
adamwulf merged 5 commits intoadamwulf:masterfrom
simonmeadows:master
Apr 3, 2017
Merged

Added preserving thead and tfoot in tables - Issue #180#219
adamwulf merged 5 commits intoadamwulf:masterfrom
simonmeadows:master

Conversation

@simonmeadows
Copy link
Contributor

In the columnize function we can check weather we are in a table by testing the first child of $pullOutHere
If we are in a table we can clone a copy of the and if they exist and store thim in the columnize function that is operating on the table.
When we get to splitting the last element we add the and back to the table in the content source element $pullOutHere

In the columnize function we can check weather we are in a table by testing the first child of $pullOutHere
If we are in a table we can clone a copy of the <thead> and <tfoot> if they exist and store thim in the columnize function that is operating on the table.
When we get to splitting the last element we add the <thead> and <tfoot> back to the table in the content source element $pullOutHere
@simonmeadows simonmeadows changed the title Added preserving thead and tfoot in tables #180 Added preserving thead and tfoot in tables - Issue #180 Mar 31, 2017
@adamwulf
Copy link
Owner

adamwulf commented Mar 31, 2017

Awesome - this is a great idea. Can you add a test/sample.html that shows it in action and acts as a test case for it? It'd be interesting to see a test on nested tables as well.

@simonmeadows
Copy link
Contributor Author

I have added a couple of sample pages to show the behaviour.
I didn't think about nested tables initially as I wasn't going to use them but it was an interesting challenge.
I have changed the way it remembers the and by creating an array of all of them for every table.
It iterates through the page and adds a unique ID as a class to each table then saves an object containing the class ID, the , and the
Every time split() returns, it calls a function to re-add the and to the un-columnized content so it is ready for the next round.

@adamwulf adamwulf merged commit 11ad353 into adamwulf:master Apr 3, 2017
@adamwulf
Copy link
Owner

adamwulf commented Apr 3, 2017

awesome thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants