• Resolved Raul Flores

    (@raflo64)


    I installed the TablePress Extension: DataTables FixedHeader plugin and added the following to the Plugin Options, per a previous topic that is now closed.

    .tablepress.fixedHeader-floating {
    z-index: 1000 !important;
    }

    However, I still am unable to get the header on the first table (the only one I am testing) to remain fixed.

    We are a public transit agency and our time schedules for riders have always been downloadable PDF files. This is my first attempt at making the schedules live on the web site. I am only testing the first table (Route 2 Weekday Southbound), but we have 90+ routes. Many, like the one i am testing have multiple days (Weekday, Weekend, Saturday only, Sunday only) and directions (Southbound, Northbound, Westbound, Eastbound), so there could be close to 300 tables.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    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

    Thread Starter Raul Flores

    (@raflo64)

    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

    Plugin Author TobiasBg

    (@tobiasbg)

    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

    Thread Starter Raul Flores

    (@raflo64)

    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

    Plugin Author TobiasBg

    (@tobiasbg)

    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

    Thread Starter Raul Flores

    (@raflo64)

    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

    Plugin Author TobiasBg

    (@tobiasbg)

    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!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Fixed Header Plugin Not Executing’ is closed to new replies.