adamwulf / Columnizer-jQuery-Plugin

The Columnizer jQuery Plugin will automatically layout your content in newspaper column format. You can specify either column width or a static number of columns. And, of course, it’s easy to use!
http://welcome.totheinter.net/columnizer-jquery-plugin/
Other
758 stars 147 forks source link

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

Closed simonmeadows closed 7 years ago

simonmeadows commented 7 years ago

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

adamwulf commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

awesome thanks!