Hi,
thanks for your post, and sorry for the trouble.
Just to be sure: Did you add the new required parameter to the Shortcode for the table on this page, as explained on https://tablepress.org/extensions/datatables-fixedheader/
Unfortunately, I could not directly check this, as the page from your link seems to be password-protected.
Regards,
Tobias
Hello Tobias,
Thanks for the reply. In answer to your question, yes I added the shortcode; I added the offset as well since I have a navigation bar. And I also have a shortcode for responsive scroll. So it looks like this:
[table id=389 datatables_fixedheader=top datatables_fixedheader_offsettop=160 responsive= scroll /]
I did try the shortcode without the responsive scroll just to see if it would work.
I have temporarily removed the password protection, but changed the url just to make a little less conspicuous on the site.
https://www.viainfo.net/test_10112021/
Thanks, RAF
Hi,
thanks for that! The reason why the FixedHeader is not working is that your tables use the #colspan# keyword to merge/connect cells (in their last rows). Unfortunately, the external DataTables JavaScript library and the FixedHeader JS code are not compatible with that. They require that a table does not have merged/connected cells.
Thus, to use the FixedHeader, you’d have to remove all #colspan# from these tables.
However, even if you did that, the FixedHeader will likely not work as desired, due to the tables being shown inside collapsable/expandandable sections. Using those essentially means that the table is initially hidden, which means that the JS code can not make certain calculations, like column widths, etc. Thus, the floating header cells will not be matching the actual column positions.
The latter might change in the future, with an update of the FixedHeader JS code, but unfortunately, I’m not aware of a solution that’s already available now 🙁 Sorry.
Regards,
Tobias
Thanks Tobias,
I removed the #colspan# from the tables, and they appear to be working even with the collapsable sections. I’ll figure out a workaround on the 4 rows that had the #colspan# on them.
Perhaps I’ll test creating and adding a second table just below the primary with those four rows, since the information for each route is different.
I’ll keep you posted.
But thanks for your expertise and help.
Cordially, Raul
Hi Raul,
awesome! That’s great to hear, especially with the header still working despite of the collapsable sections!
Yes, moving that information to a separate small table would be an option. Or, you could just add it as normal text below the table, e.g. in the table description, which you could have printed below the table.
Regards,
Tobias
Hello Tobias, I never even thought about the description field and displaying it at the bottom. I tried that, and it works like a gem. Saves the trouble of having to create a second table and keeping track of which secondary table goes with the primary table.
Plus, I can use standard HTML code to adjust the size, alignment, etc.
Thanks again for all your help.
Cordially, RAF
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!