The current code for creating the table containing the sticky columns just looks at the .sticky-column cells in the original table and creating a copy as an HTML string.
While this does work in a lot of cases, copying some of the styles, but not others, not copying the classes, etc., all can lead to problems in special cases.
In my tests, just using jQuery's clone() method to create the table (and then removing all cells without class sticky-column) not only makes for much cleaner code, but also works in more cases.
Your mileage may of course vary, but I thinking using this as a base and fixing the problems this creates, if any, would make for a cleaner code base.
(Note, also, that setting the width of a table cell will usually be ignored by browsers unless the table-layout is fixed.)
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 2502821-1--create_table_with_clone.patch | 2.7 KB | drunken monkey |
Comments
Comment #1
drunken monkeyThis is the method I would suggest.
Comment #3
trim108 commented