WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] DataTables/colspan issue (11 posts)

  1. jmarkj
    Member
    Posted 1 year ago #

    Hi Tobias,

    I really like the plugin thus far, but I have one nagging issue. It seems that trying to invoke colspan when DataTables functionality is selected causes an error message that prevents saving changes. And the only way to get colspan to work is to deselect DataTables. Once my table was completed, I realized it was so long that I needed to invoke pagination so users would always see the header. At that point, I can select DataTables and pagination functionality at that point and save properly, but no pagination is actually reflected on the page. Are colspan and DataTables simply incompatible with each other? And if so, is there another way I should be invoking a colspan-type result of formatting column cells? You can see the table under development at this link: http://s90778212.onlinehome.us/pii/calendar/

    http://wordpress.org/extend/plugins/tablepress/

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    thanks for your question, and sorry for the trouble.

    Unfortunately, you nailed it: Colspan and DataTables are incompatible, unfortunately. Due to that, DataTables will raise that error message when being used on tables which have connected cells.

    Sorry for not having better news.

    Best wishes,
    Tobias

  3. jmarkj
    Member
    Posted 1 year ago #

    Hi Tobias, I have now progressed forward in time where we are trying to launch the site that I wanted to deploy TablePress in. However, now the client is adamant about wanting to have a result that is normally achieved by using Colspan. I realize that TablePress is not compatible with DataTables as we discussed before, but do you have any suggestions on how to mimic the effect?

    This link is to the legacy site calendar page that is using a simple HTML table to display the colspan process:

    http://www.process-improvement-institute.com/calendar.html

    as in the line for Course 1, in the section that contains "(only offered as a private course at client site)" spanned across several cells

    This link is the new site under development that has the table being generated by TablePress:


    http://s90778212.onlinehome.us/pii/calendar/

    Just trying to figure out how to develop an alternative so I can still deploy TablePress. Thanks!

  4. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    unfortunately, I don't really have suggestions here, sorry :-(
    It's not that TablePress is incompatible here in anyway, the problem is that the DataTables JS library simply does not support tables with combined cells via colspan. There was a recent support ticket for DataTables at https://github.com/DataTables/DataTables/issues/172 that doesn't leave too much hope here for the future :-(

    So, the bottom line is: Either use the combined cells (colspan), or use the DataTables features. Both at the same time are not possible at this time, unfortunately :-(

    Regards,
    Tobias

  5. jmarkj
    Member
    Posted 1 year ago #

    OK thanks Tobias, I appreciate the feedback!

  6. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    sure, no problem! You are very welcome!
    Sorry that I couldn't really help...

    Best wishes,
    Tobias

  7. David Sarver
    Member
    Posted 1 year ago #

    jmarkj, The colspan issue was brought up at my site when an administrator had a table with a header that spanned all three rows and the table broke the javascript dependent navigation.

    I've found an example of how spanning might be used when working with DataTables which you might find helpful. http://www.datatables.net/release-datatables/examples/basic_init/complex_header.html

  8. David Sarver
    Member
    Posted 1 year ago #

    Yep, sorry. I should've looked at your table before replying; that demo does not apply to your issue.

  9. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi David,

    thanks for sharing this information! Yes this solution could be helpful for combined cells in a table head row, but as it requires two table head rows, this won't directly work in TablePress, as TablePress only supports one head row.
    This is however helpful if one can add the head row with other ways, like custom JavaScript code.

    Best wishes,
    Tobias

  10. jmarkj
    Member
    Posted 1 year ago #

    I may have come up with a solution pending the client's approval. the only thing I really needed DataTables for was pagination (so the head row would always be in view), so I turned off DataTables, deployed colspan on the rows where I needed it, and then just used custom CSS to mimic the header row in multiple row instances down the page (every 5 courses). We'll see how the client feels. The current development page is at:

    http://s90778212.onlinehome.us/pii/calendar/

    And if the production page ends up the same way, I'll post that URL here at that time, to benefit any others experiencing this issue. Thanks Tobias and David!

  11. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    yes, that also looks like a nice solution for your problem! :-)

    Best wishes,
    Tobias

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic